我在 CentOS 上遇到了 DNS 服务器问题。我有一个域名 cloudauth.me,是从 godaddy.com 购买的。
我为这个域名添加了 glue 记录。我使用 ns1.cloudauth.me 和 ns2.cloudauth.me 配置了名称服务器。这个子域名的 IP 地址是 199.175.53.128,这是我在 godaddy 上配置的。199.175.53.128 是我的 VPS 的 IP。
现在我想在 CentOS 上配置 dns 服务器。
我的配置是这样的/etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind 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.
//
options {
listen-on port 53 { 127.0.0.1;199.175.53.128; };
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; };
recursion yes;
allow-recursion {127.0.0.1; 199.175.53.128;};
query-source address * port 53;
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";
};
zone "cloudauth.me" {
type master;
file "/var/named/cloudauth.me.hosts";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
域区域文件是这个。/var/named/cloudauth.me.hosts
$ttl 38400
@ IN SOA ns1.cloudauth.me. ns2.cloudauth.me. (
100 ; serial
1H ; refresh
1M ; retry
1W ; expiry
1D) ; minimum
cloudauth.me. 86400 IN A 199.175.53.128
cloudauth.me. 86400 IN NS ns1.cloudauth.me.
cloudauth.me. 86400 IN NS ns2.cloudauth.me.
ns1 86400 IN A 199.175.53.128
ns2 86400 IN A 199.175.53.128
www 86400 IN A 199.175.53.128
问题是域名 cloudauth.me 无法正常工作。我检查了许多 nslookup 服务器。我的域名无法解析。我的配置有什么问题?
答案1
我发现了问题。问题出在这一行
allow-query { localhost; };
对于远程访问绑定服务器,此行必须遵循
allow-query { any; };
这次更换解决了这个问题