这是我的named.conf
// // named.caching-nameserver.conf // // Provided by Red Hat caching-nameserver package to configure the // ISC BIND named(8) DNS server as a caching only nameserver // (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // // DO NOT EDIT THIS FILE - use system-config-bind or an editor // to create named.conf - edits to this file will be lost on // caching-nameserver package upgrade. // options { listen-on port 53 { 127.0.0.1; 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"; forward only; forwarders { # the following IP addresses are my ISPs DNS Servers. These will be used for looking up # hostnames that I don't locally manage, ie the REST OF THE INTERNET! XXX; # my ISPs DNS Server #1 XXX; # my ISPs DNS Server #2 }; // Those options should be used carefully because they disable port // randomization // query-source port 53; // query-source-v6 port 53; allow-query { localhost; }; allow-query-cache { localhost; }; allow-recursion { localhost; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { localhost; }; match-destinations { localhost; }; recursion yes; include "/etc/named.rfc1912.zones"; zone "domain.com" { type master; file "domain.com.db"; }; }; include "/etc/rndc.key";
这是我的区域文件:
; Zone file for domain.com $TTL 14400 domain.com. 86400 IN SOA ns1.domain.com. user.email.com. ( 2013032213 ;Serial Number 86400 ;refresh 7200 ;retry 3600000 ;expire 86400 ) domain.com. 86400 IN NS ns1.domain.com. domain.com. 86400 IN NS ns2.domain.com. ns1.domain.com. 14400 IN A xxx ns2.domain.com. 14400 IN A xxx domain.com. 14400 IN A xxx localhost 14400 IN A 127.0.0.1 www 14400 IN CNAME domain.com. ftp 14400 IN A xxx
绑定正在运行。 named-checkconf和named-checkzone return ok。 域名服务器也是在域名注册商处创build的。 该服务器还具有eth0:x … eth0:n中的IP。 任何想法我可能做错了什么?
我看到您的configuration有两个问题:
allow-query { localhost; }; allow-query { localhost; }; 。 这将指示您的绑定DNS服务器仅回答本地主机,并自动从其他IP地址中删除所有查询。 match-clients和match-destinations选项的IP地址。 由于这两个问题,您的DNS服务器不应答任何域的请求:
$ host -t ns -v lucasgomez.com. 209.236.113.167 Trying "lucasgomez.com" ;; connection timed out; no servers could be reached
我build议你创build一个额外的视图,为您的公共区域服务。 您不需要在那里启用recursion,也不需要黑洞区域,它应该匹配并回答来自任何IP地址的查询。
view "external-in" in { match-clients { any; }; notify yes; recursion no; additional-from-auth no; additional-from-cache no; auth-nxdomain no; # conform to RFC1035 allow-query { any; }; zone "example.com" in { type master; file "example.com.db"; allow-transfer { xferservers; }; }; };
请注意,您需要添加一个名为xferservers的ACL,其IP地址应该能够启动AXFR和IXFR区域传输,并调整您的从属DNS服务器的区域片段。
PS。 在应用之前,请务必检查您的configuration。
zorlem根据您提供的信息提供了最好的答案,但是我还想补充说,有几个优秀的诊断网站可以减less许多不同的“挖掘”命令的负担,您需要做的就是全面诊断DNS问题。
一个我用了很多是http://dns.squish.net/有以下说你的域名:
Results 50.0% recvfrom failed from 209.236.113.167; Connection refused - recvfrom(2) at ns1.lucasgomez.com (209.236.113.167) 50.0% recvfrom failed from 209.236.113.168; Connection refused - recvfrom(2) at ns2.lucasgomez.com (209.236.113.168)
所以,至less你的名字不会在这些IP上监听连接。