为什么dig无法解释我自己的DNS服务器的响应?

时间:2018-09-03 09:05:10

标签: python networking dns network-programming dig

我正在尝试设置自定义DNS服务器。我正在使用以下代码:

http://code.activestate.com/recipes/491264-mini-fake-dns-server/

Nslookup可以解释DNS服务器的响应:

➜  ~ nslookup google.com 192.168.4.243
Server:         192.168.4.243
Address:        192.168.4.243#53

Non-authoritative answer:
Name:   google.com
Address: 192.168.1.1

但是,dig无法解释它:

➜  ~ dig google.com @192.168.4.243

; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com @192.168.4.243
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35382
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: Message has 16 extra bytes at end

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.                    IN      A

;; Query time: 0 msec
;; SERVER: 192.168.4.243#53(192.168.4.243)
;; WHEN: Mon Sep 03 11:59:38 +03 2018
;; MSG SIZE  rcvd: 55

即使ping命令也可以解释它:

root@xx:~# ping google.com
PING google.com (192.168.1.1) 56(84) bytes of data.
64 bytes from test-vm (192.168.1.1): icmp_seq=1 ttl=64 time=0.145 ms
64 bytes from test-vm (192.168.1.1): icmp_seq=2 ttl=64 time=0.440 ms
64 bytes from test-vm (192.168.1.1): icmp_seq=3 ttl=64 time=0.356 ms

如何解决此问题?怎么了?为什么不能挖掘解释结果?

0 个答案:

没有答案