如果你使用ping,可能终端只会返回一句Ping request could not find host www.wtfaboutthis.org. 使用dig可以比ping获取到的信息更多。比起nslookup也更加详细,nslookup只返回一个状态,且与dig使用的系统库不同,nslookup使用了自己的一套库,某些协会也在呼吁人们停止使用nslookup,因为可能产生意外错误。
; <<>> DiG 9.16.4-Debian <<>> +trace github.io ;; global options: +cmd . 6595 IN NS f.root-servers.net. . 6595 IN NS i.root-servers.net. . 6595 IN NS b.root-servers.net. . 6595 IN NS l.root-servers.net. . 6595 IN NS c.root-servers.net. . 6595 IN NS j.root-servers.net. . 6595 IN NS d.root-servers.net. . 6595 IN NS e.root-servers.net. . 6595 IN NS h.root-servers.net. . 6595 IN NS g.root-servers.net. . 6595 IN NS m.root-servers.net. . 6595 IN NS k.root-servers.net. . 6595 IN NS a.root-servers.net. ;; Received 824 bytes from 172.25.193.11#53(172.25.193.11) in 0 ms
github.io. 3247 IN A 185.199.108.153 github.io. 3247 IN A 185.199.109.153 github.io. 3247 IN A 185.199.110.153 github.io. 3247 IN A 185.199.111.153 ;; Received 102 bytes from 198.97.190.53#53(h.root-servers.net) in 37 ms
;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;github.io. IN A
;; ANSWER SECTION: github.io. 3470 IN A 185.199.108.153 github.io. 3470 IN A 185.199.109.153 github.io. 3470 IN A 185.199.110.153 github.io. 3470 IN A 185.199.111.153