zone "voidking.com" { type master; file "/etc/bind/db.voidking.com"; };
zone "0.0.10.in-addr.arpa" { type master; file "/etc/bind/db.10.0.0"; };
添加正解区域“voidking.com”,以及反解区域“10.0.0.0”
2、创建 db.voidking.com 配置文件
1 2 3
cd /etc/bind sudocp db.local db.voidking.com sudo vim db.voidking.com
添加一个A记录到10.0.0.100:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS localhost. @ IN A 127.0.0.1 @ IN AAAA ::1 dns IN A 10.0.0.100
3、创建 db.10.0.0 配置文件
1 2
sudocp db.127 db.10.0.0 sudo vim db.10.0.0
添加100的反向解析到dns.voidking.com:
1 2 3 4 5 6 7 8 9 10 11 12 13
; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA localhost. root.localhost. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS voidking.com. 100 IN PTR dns.voidking.com.
4. 测试使用DNS服务
1、测试访问
1
ping dns.voidking.com
这次访问会提示 connection timed out: no servers could be reached,或者提示 ping: unknown host dns.voidking.com
// If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder.
forwarders { 180.76.76.76; };
allow-query { 0.0.0.0/0; };
//======================================================================== // If BIND logs error messages about the root key being expired, // you will need to update your keys. See https://www.isc.org/bind-keys //======================================================================== dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; };