In web development, the http protocol is always familiar, and the first process to start before starting a http is DNS resolution. Simply put, the process of how the domain name finally resolves to the actual server ip.
A powerful tool for studying DNS resolution and troubleshooting DNS resolution problems is dig. There is a more traditional command nslookup corresponding to him, but dig as an updated command, its powerful and concise and customizable output also makes the operation and maintenance of its developers.
Instance 1 (Access the server local DNSserver to query the root domain name server): ~#: dig
; <<>> DiG 9.3.6-P1-RedHat-9.3.6 -20.P1.el5_8.6 <<>> ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39027 ;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
;; QUESTION SECTION: ;. IN NS ;; ANSWER SECTION: . 85715 IN NS a.root -servers.net. . 85715 IN NS l.root-servers.net. . 85715 IN NS f.root-servers.net. . 85715 IN NS d.root-servers.net. . 85715 IN NS e.root-servers .net. . 85715 IN NS b.root-servers.net. . 85715 IN NS c.root-servers.net. . 85715 IN NS m.root-servers.net. . 85715 IN NS k.root-servers.net 85715 IN NS i.root-servers.net. . 85715 IN NS j.root-servers.net. . 85715 IN NS h.root-servers.net. . 85715 IN NS g.root-servers.net.< Br>
Instance 2 (Baidu Home DNS Resolution): dig www.baidu.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20. P1.el5_8.6 <<>> www.baid U.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15372 ;; flags: qr rd ra; QUERY: 1, ANSWER : 3, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ; www.baidu.com. IN A ;; ANSWER SECTION: www.baidu.com. 641 IN CNAME www.a.shifen.com. www.a. Shifen.com. 110 IN A 180.97.33.107 www.a.shifen.com. 110 IN A 180.97.33.108 ;; Query time: 1 msec ;; SERVER: 192.168.100.52#53(192.168.100.52) ;; WHEN: Wed Aug 13 22:33:59 2014 ;; MSG SIZE rcvd: 90
Example 3 (developing a google domain name server to resolve Baidu homepage); dig @8.8.8.8 www.baidu.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> @8.8.8.8 www.baidu.com ; (1 server Found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44033 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ; www.baidu.com. IN A ;; ANSWER SECTION: www.baidu.com. 557 IN CNAME www .a.shifen.com. www.a.shifen.com. 299 IN A 180.76.3.151 ;; Query time: 615 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Wed Aug 13 22 :36:36 2014 ;; MSG SIZE rcvd: 74
Example 4 (use the +trace option to view the process from the root name server to the final resolution to ip): dig www.baidu.com +trace
. 84899 IN NS f.root-servers.net. . 84899 IN NS d.root-servers.net. . 84899 IN NS e.root-servers.net. . 84899 IN NS b.root-servers.net 84899 IN NS c.root-servers.net. . 84899 IN NS m.root-servers.net. . 84899 IN NS k.root-servers.net. . 84899 IN NS i.root-servers.net. 84899 IN NS j.root-servers.net. . 84899 IN NS h.root-servers.net. . 84899 IN NS g.root-servers.net. . 84899 IN NS a.root-servers.net. . 84899 IN NS l.root-servers.net. ;; Received 509 bytes from 192.168.100.52#53(192.168.100.52) in 1 ms
Description: Get several root name servers from the local DNS server com. 172800 IN NS a.gtld-servers.net. com. 172800 IN NS e.gtld-servers.net. com. 172800 IN NS h.gtld-servers.net. com. 172800 IN NS j.gtld-servers.net. com. 172800 IN NS i.gtld-servers.net. com. 172800 IN NS k.gtld-servers.net. com. 172800 IN NS b.gtld-servers.net. com 172800 IN NS m.gtld-servers.net. com. 172800 IN NS f.gtld-servers.net. com. 172800 IN NS g.gtld-servers.net. com. 172800 IN NS c.gtld-servers.net Com. 172800 IN NS d.gtld-servers.net. com. 172800 IN NS l.gtld-servers.net. ;; Received 503 bytes from 192.5.5.241#53(f.root-servers.net) in 39 ms Description: Select f.root-servers.net root domain name server to query com domain name server baidu.com. 172800 IN NS dns.baidu.com. baidu.com. 172800 IN NS ns2.baidu.com. baidu.com. 172800 IN NS Nb3.baidu.com. baidu.com. 172800 IN NS ns4.baidu.com. baidu.com. 172800 IN NS ns7.baidu.com. ;; Received 201 bytes from 192.5.6.30#53(a.gtld-servers. Net) in 360 ms Description: Select the com domain name server of a.gtld-servers.net to resolve the domain name server of baidu.com www.baidu.com. 1200 IN CNAME www.a.shifen.com. a.shifen.com. 1200 IN NS ns3.a.shifen.com. a.shifen.com. 1200 IN NS ns5.a.shifen.co Mashifen.com. 1200 IN NS ns1.a.shifen.com. a.shifen.com. 1200 IN NS ns4.a.shifen.com. a.shifen.com. 1200 IN NS ns2.a.shifen.com. ;; Received 228 bytes from 202.108.22.220#53(dns.baidu.com) in 206 ms
Description: resolve to www.baidu.com as www.adu.com by choosing to access the dns.baidu.com domain name server Alias of .shifen.com;
So we dig down www.a.shifen.com.
[root@local200-65 JakQuan]# dig www.a.shifen.com + Short 180.97.33.108 180.97.33.107
How to install JDK graphic parsing in Ubuntu, for many friends who dont know how to operate,
The following folder on the desktop is shared as a shared folder to the Linux system in the virtual
1. Introduction to Firewalls Firewall Concept Firewalls can filter datagrams and restrict specific s
Has been doing the account management system of the Linux server in the lab. At this stage, after re
Linux ubuntu12.04 Uninstall and install mysql
Three main package installation methods under redhat system
Set the permissions of multiple groups on a file under linux (setfaclgetfacl) method - management
Linux/CentOS to open the firewall
Method for obtaining public network IP address under Linux
Hard disk mount in linux system
Small note IptabLes and IptabLex virus cleanup process
How do famine novice players make it longer to survive
7 security problems set by default on Windows XP system
Windows 7 rejected the wireless router troubleshooting examples
How to set up Wake on LAN for T168 G6/T468 G6 server?
How to set up sharing of printer devices under Win8 system
How can I solve the problem that Win8.1 cannot change the computer settings?
Can't find a problem with DVD or DVD drive on win8
Win7 system right-click menu does not have winrar option how to do