我在CentOS 6服务器上安装了 bind
,用于配置DNS区域以定义域 . 我的 /etc/named.conf
是这样的:
options {
# listen-on port 53 { 127.0.0.1; };
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 no;
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";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
zone "xxxxxx.yyy" IN {
type master;
file "xxxxxx.yyy.zone";
allow-update {none;};
};
和我的区域配置文件( /var/named/xxxxxx.yyy.zone
)基于TLDP是:
$TTL 86400
@ IN SOA ns1.xxxxxx.yyy. root.xxxxxx.yyy. (
2014011001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS ns1.xxxxxx.yyy.
@ IN NS ns2.xxxxxx.yyy.
ns1 IN A aaa.bbb.cc.ddd
ns2 IN A aaa.bbb.cc.ddd
我将域的名称服务器设置为 ns1.xxxxxx.yyy
和 ns2.xxxxxx.yyy
,我可以在whois上获取此名称服务器:
meysam@freedom:~$ whois xxxxxx.yyy
// blah blah blah
% Information related to 'xxxxxx.yyy'
domain: xxxxxx.yyy
ascii: xxxxxx.yyy
// blah blah blah
nserver: ns1.xxxxxx.yyy
nserver: ns2.xxxxxx.yyy
但是当我ping域时,它返回未知的主机错误:
meysam@freedom:~$ ping xxxxxx.yyy
ping: unknown host xxxxxx.yyy
也输出 nslookup
类似:
meysam@freedom:~$ nslookup xxxxxx.yyy
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
*** Can't find yyyyyy.xxx: No answer
有关更多信息,我追加 dig
命令的输出:
meysam@freedom:~$ dig xxxxxx.yyy
; <<>> DiG 9.9.5-3ubuntu0.5-Ubuntu <<>> xxxxxx.yyy
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57346
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;xxxxxx.yyy. IN A
;; AUTHORITY SECTION:
xxxxxx.yyy. 6606 IN SOA ns1.xxxxxx.yyy. root.xxxxxx.yyy. 2014011001 3600 1800 604800 86400
;; Query time: 123 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Fri Dec 25 20:57:36 IRST 2015
;; MSG SIZE rcvd: 87
有什么问题?我该如何解决这个错误?
欢迎任何指南 . 谢谢 .
1 回答
当没有为域的根定义时,您似乎正在查询A记录 .
尝试在区域文件中添加一个 .