域名解析工具nslookup和dig对比
nslookup和dig默认都会输出所有解析地址,包括ipv4和ipv6。
dig -4和-6表示分别只用ipv4和ipv6来解析地址,nslookup不支持。
root@root1:~# nslookup -debug www.baidu.com
Server: 127.0.0.53
Address: 127.0.0.53#53
------------
QUESTIONS:
www.baidu.com, type = A, class = IN
ANSWERS:
-> www.baidu.com
canonical name = www.a.shifen.com.
ttl = 285
-> www.a.shifen.com
internet address = 180.101.51.73
ttl = 67
-> www.a.shifen.com
internet address = 180.101.49.44
ttl = 67
AUTHORITY RECORDS:
ADDITIONAL RECORDS:
------------
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 180.101.51.73
Name: www.a.shifen.com
Address: 180.101.49.44
------------
QUESTIONS:
www.a.shifen.com, type = AAAA, class = IN
ANSWERS:
-> www.a.shifen.com
has AAAA address 240e:e9:6002:1ac:0:ff:b07e:36c5
ttl = 61
-> www.a.shifen.com
has AAAA address 240e:e9:6002:1fd:0:ff:b0e1:fe69
ttl = 61
AUTHORITY RECORDS:
ADDITIONAL RECORDS:
------------
Name: www.a.shifen.com
Address: 240e:e9:6002:1ac:0:ff:b07e:36c5
Name: www.a.shifen.com
Address: 240e:e9:6002:1fd:0:ff:b0e1:fe69
root@root1:~# dig www.baidu.com
; <<>> DiG 9.20.0-2ubuntu3.2-Ubuntu <<>> www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8443
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 3
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.baidu.com. IN A
;; ANSWER SECTION:
www.baidu.com. 104 IN CNAME www.a.shifen.com.
www.a.shifen.com. 220 IN A 180.101.49.44
www.a.shifen.com. 220 IN A 180.101.51.73
;; ADDITIONAL SECTION:
www.a.shifen.com. 104 IN AAAA 240e:e9:6002:1fd:0:ff:b0e1:fe69
www.a.shifen.com. 104 IN AAAA 240e:e9:6002:1ac:0:ff:b07e:36c5
;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Sun Nov 30 09:25:35 UTC 2025
;; MSG SIZE rcvd: 157
浙公网安备 33010602011771号