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 { localhost; 175.75.517.715; };
recursion no;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
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";
};
zone "mydomain.com" IN {
type master;
file "mydomain.com.zone";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
Mydomain.com.zone 文件:
$ORIGIN mydomain.com.
$TTL 86400
@ IN SOA ns1.mydomain.com. doors.mydomain.com. (
2014111301 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS ns1.mydomain.com.
IN NS ns2.mydomain.com.
ns1 IN A 175.75.517.715
ns2 IN A 175.75.517.715
localhost IN A 127.0.0.1
IN A 175.75.517.715
@ IN A 175.75.517.715
www IN A 175.75.517.715
我不知道为什么它不起作用,域名在注册中心配置正确。使用的 IP 是外部 IP,我只有一个 IP。知道我做错了什么吗?
根据日志显示,似乎每个查询都被“拒绝”。 错误示例:
client 111.111.111.111#36576: query 'mydomain.com/A/IN' denied
使用 CentOS6.6 和 Bind9 (9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6)
答案1
如果这是一个权威服务器,您可能需要更改一些内容。
allow-query { localhost; 175.75.517.715; };
这句话允许查询仅来自这两个地址。
recursion no;
这可能是一件好事,除非您是 ISP,或者为自己的网络运行 DNS 服务器。