我在我的Ubuntu 16.04机器上安装了bind9。
但是我解决本地域问题。 外部像google.com工作正常。
这里是我的configuration文件和我做的故障排除。
前锋:
$TTL 2D @ IN SOA ns.mancina.home. root.mancina.home. ( 22 ; Serial 8H ; Refresh 2H ; Retry 4W ; Expire 3H ) @ IN NS ns.mancina.home. IN A 192.168.1.150 ns IN A 192.168.1.150 lenny IN A 192.168.1.150 homer IN A 192.168.1.110
相反:
$TTL 2D @ IN SOA ns.mancina.home. root.mancina.home. ( 2 ; Serial 8H ; Refresh 2H ; Retry 4W ; Expire 3H ) @ IN NS ns.mancina.home. 150 IN PTR lenny.mancina.home. 110 IN PTR homer.mancina.home.
named.conf.local
root@lenny:/etc/bind# cat named.conf.local // // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include "/etc/bind/zones.rfc1918"; logging { channel query.log { file "/var/log/query.log"; severity info; print-time yes; print-severity yes; print-category yes; }; category queries { query.log; }; };
named.local.conf
zone "mancina.home" { type master; file "/etc/bind/db.mancina.home"; }; zone "1.168.192.in-addr.arpa" { type master; file "/etc/bind/db.1.168.192"; };
named.conf.options
root@lenny:/etc/bind# cat named.conf.options options { directory "/var/cache/bind"; forwarders { 8.8.8.8 ; }; dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; };
testing
root@lenny:/etc/bind# named-checkzone db.mancina.home ./db.mancina.home zone db.mancina.home/IN: loaded serial 22 OK dig lenny.mancina.home ; <<>> DiG 9.10.3-P4-Ubuntu <<>> lenny.mancina.home ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 17304 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;lenny.mancina.home. IN A ;; AUTHORITY SECTION: . 10610 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2017071400 1800 900 604800 86400 ;; Query time: 0 msec ;; SERVER: 192.168.1.150#53(192.168.1.150) ;; WHEN: Fri Jul 14 18:01:46 CEST 2017 ;; MSG SIZE rcvd: 122 nslookup lenny.mancina.home Server: 192.168.1.150 Address: 192.168.1.150#53 ** server can't find lenny.mancina.home: NXDOMAIN root@lenny:~# nslookup google.com Server: 192.168.1.150 Address: 192.168.1.150#53 Non-authoritative answer: Name: google.com Address: 216.58.205.142
我希望任何人都可以在conf中看到一个错误,或给我一个build议,可能是错误的。
TIA Mattia
named.local.conf不包含在named.conf中
将这一行添加到named.conf :
include "/etc/bind/named.local.conf";