前戏
大型局域网,要自架设DNS,配置成转发DNS后,不定时,不定量出现部分域名无法解析的现象。
选择:CensOS+BIND9
自架DNS-IP:10.10.10.10
上游DNS:1.2.3.10 ; 1.2.3.20
named.conf参数:
options
{
directory "/var/named";
allow-query { 0.0.0.0/0; };
allow-query-cache { 0.0.0.0/0; };
forward only;
recursion yes;
datasize 200M;
dump-file "/var/named/named.dump_db";
forwarders { 1.2.3.10 ; 1.2.3.20; };
};
症状:
============================================
客户机访问trade.taobao.com [提示无法解析]
客户机nslookup 后得到:
服务器: UnKnown
Address: 10.60.3.74
非权威应答:
名称:
trade.taobao.com然后就没了。。。
---------------------------------------------
自建DNS上使用dig命令得到
[自建DNS-10.10.10.10 ~]# dig
trade.taobao.com @
10 .10.10.10
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6 <<>>
trade.taobao.com @
10 .10.10.10
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49060
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;trade.taobao.com. IN A
;; ANSWER SECTION:
trade.taobao.com. 832 IN CNAME
trade.gds.taobao.com.
;; AUTHORITY SECTION:
gds.taobao.com. 766 IN SOA
gdsns1.taobao.com.
hostmaster.gds.taobao.com. 2014070916 1800 600 1814400 300
;; Query time: 0 msec
;; SERVER: 10.10.10.10#53(10.10.10.10)
;; WHEN: Mon Nov 10 09:52:01 2014
;; MSG SIZE rcvd: 112
[自建DNS-10.10.10.10 ~]# dig
trade.taobao.com @
1 .2.3.10
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6 <<>>
trade.taobao.com @
1 .2.3.10
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6295
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 4
;; QUESTION SECTION:
;trade.taobao.com. IN A
;; ANSWER SECTION:
trade.taobao.com. 912 IN CNAME
trade.gds.taobao.com.
trade.gds.taobao.com. 600 IN A 140.205.133.112
;; AUTHORITY SECTION:
gds.taobao.com. 25119 IN NS
gdsns2.taobao.com.
gds.taobao.com. 25119 IN NS
gdsns1.taobao.com.
;; ADDITIONAL SECTION:
gdsns1.taobao.com. 2816 IN A 198.11.138.254
gdsns1.taobao.com. 2816 IN A 140.205.66.254
gdsns2.taobao.com. 19 IN A 42.120.227.254
gdsns2.taobao.com. 19 IN A 140.205.67.254
;; Query time: 19 msec
;; SERVER: 1.2.3.10#53(1.2.3.10)
;; WHEN: Mon Nov 10 09:52:11 2014
;; MSG SIZE rcvd: 180
========================================
总结,
就是说,从自建DNS后,这个域名就解析不到了,
而在自建DNS本身上使用dig
trade.taobao.com ,却可以正确解析IP。
不过一旦加上@参数(即:dig
trade.taobao.com @
10 .10.10.10),便无法得到结果。
尝试各种重装,都会出现这个问题。
一般持续10~30分钟不等。
求各位救我于水深火热之中。
另附防火墙配置:
[自建DNS-10.10.10.10]# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 127.0.0.1 127.0.0.1
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp spt:53
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp spt:53