内网dns服务器搭建

   免费的内网穿透,内网端口映射工具,无需设置路由器,公网IP,不限流量,不限连接数
了解更多  立即下载
FinalShell最好用的国产SSH客户端,一体化服务器管理软件,点击获取

[root@DNS ~]# yum install -y bind*

修改主配置文件:

[root@DNS named]# vim /etc/named.conf

options {
    listen-on port 53 { any; };
    //listen-on-v6 port 53 { ::1; };
    directory   "/var/named";
    dump-file   "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { any; };
    recursion yes;

    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";
};

[root@DNS named]# vim /etc/named.rfc1912.zones

zone "ctfo.com" IN {
        type master;
        file "ctfo.com.zone";
        allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "1.168.192.zone";
        allow-update { none; };
};

[root@DNS ~]# vim /var/named/ctfo.com.zone

$TTL 86400
@ IN SOA ns.ctfo.com. root (
42 ; serial
3H ; refresh
11M ; retry
1W ; expire
1D ) ; minimum
@ IN NS ns.ctfo.com.
ns IN A 192.168.1.254
www IN A 192.168.1.254
bss IN A 192.168.1.254
@ IN MX 10 mail.ctfo.com.
mail IN A 192.168.1.254

vim /var/named/5.168.192.zone

$TTL 86400
@ IN SOA ns.abc.com. root (
42 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum

@ IN NS ns.abc.com.
254 IN PTR mail.abc.com.
254 IN PTR ns.abc.com.
254 IN PTR www.abc.com.

重启dns服务:

分享到: 更多 (0)