配置DNS Server容易忽略的问题
1.named服务启动成功,但nslookup解析报错:
[root@xiamihost3 named]# service named restart 停止 named: [确定] 启动 named: [确定] [root@xiamihost3 named]# nslookup www.hngd.com ;; connection timed out; trying next origin ;; connection timed out; no servers could be reached
提示找不到服务器,查看所设置的服务器地址:
[root@xiamihost3 named]# cat /etc/resolv.conf ; generated by /sbin/dhclient-script search xiamihost3.localdomain nameserver 192.168.119.132
再查看named.conf所设置的服务器地址:
[root@xiamihost3 named]# cat /var/named/chroot/etc/named.conf|grep -i listen listen-on port 53 { 127.0.0.1; }; // listen-on-v6 port 53 { ::1; };
两个地址不匹配,一个为本机环回地址,一个为ip地址。在linsten-on port地址中加入本机IP地址即可:
listen-on port 53 { 127.0.0.1;192.168.119.132; };