Article Title: dig understands the DNS resolution process. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
[Root @ localhost ~] # Dig www.a.com
; <> DiG 9.2.4 <> www.a.com
; Global options: printcmd
; Got answer:
;-> HEADER <-opcode: QUERY, status: NOERROR, id: 25746
; Flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 6
; Question section:
; Www.aslibra.com. IN
; Answer section:
Www.aslibra.com. 900 in a 222.76.215.25
; Authority section:
Aslibra.com. 33024 in ns k8.hkidc.com.
Aslibra.com. 33024 in ns B .hkidc.com.
Aslibra.com. 33024 in ns j6.hkidc.com.
Aslibra.com. 33024 in ns ns8.hkidc.com.
Aslibra.com. 33024 in ns ns5.hkidc.com.
Aslibra.com. 33024 in ns a.hkidc.com.
; Additional section:
K8.hkidc.com. 55596 in a 125.65.112.32
B .hkidc.com. 53594 IN A 221.122.64.81
J6.hkidc.com. 54375 in a 222.76.219.74
Ns8.hkidc.com. 53598 in a 221.122.64.81
Ns5.hkidc.com. 55596 in a 222.76.219.81
A.hkidc.com. 53594 in a 125.65.112.32
; Query time: 71 msec
; SERVER: 211.99.25.1 #53 (211.99.25.1)
; WHEN: Mon Jun 1 12:05:17 2009
; Msg size rcvd: 268
How to Understand the above meaning?
Question section: Query content
Answer section: the corresponding content. Generally, at least one A record is obtained. Otherwise, it is not defined.
Authority section: authorization information
Additional section: IP address of each authorized Server
SERVER: The queried dns SERVER may be cached.
The process is generally:
1. query www.a.com from the SERVER. If there is a valid cache, return
2. If not, find the authorization server of a.com. The following is an example.
3. query results from one of them (A record)
Let's take a look at the specific parsing process.
"Dig www.a.com + trace" allows you to view more specific parsing processes.
Let's use a big website, such as www.163.com.
First, let's see what we get without trace:
[Root @ localhost ~] # Dig www.163.com
; <> DiG 9.2.4 <> www.163.com
; Global options: printcmd
; Got answer:
;-> HEADER <-opcode: QUERY, status: NOERROR, id: 46550
; Flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 2, ADDITIONAL: 2
; Question section:
; Www.163.com. IN
; Answer section:
Www.163.com. 51561 in cname www.cache.gslb.netease.com.
Www.cache.gslb.netease.com. 1604 in a 61.135.253.16
Www.cache.gslb.netease.com. 1604 in a 61.135.253.17
Www.cache.gslb.netease.com. 1604 in a 61.135.253.18
Www.cache.gslb.netease.com. 1604 in a 61.135.253.9
Www.cache.gslb.netease.com. 1604 in a 61.135.253.10
Www.cache.gslb.netease.com. 1604 in a 61.135.253.11
Www.cache.gslb.netease.com. 1604 in a 61.135.253.12
Www.cache.gslb.netease.com. 1604 in a 61.135.253.13
Www.cache.gslb.netease.com. 1604 in a 61.135.253.14
Www.cache.gslb.netease.com. 1604 in a 61.135.253.15
; Authority section:
Gslb.netease.com. 1604 in ns gslb1.netease.com.
Gslb.netease.com. 1604 in ns gslb2.netease.com.
; Additional section:
Gslb1.netease.com. 15896 in a 61.135.20.143
Gslb2.netease.com. 15900 in a 220.181.28.168
; Query time: 56 msec
; SERVER: 211.99.25.1 #53 (211.99.25.1)
; WHEN: Mon Jun 1 12:29:51 2009
; Msg size rcvd: 298
The answer section tells you:
Www.163.com alias to www.cache.gslb.netease.com
Www.cache.gslb.netease.com has such A series of machines (A records) that you can choose to access.
Let's see what information is after trace is added:
[Root @ localhost ~] # Dig www.163.com + trace
; <> DiG 9.2.4 <> www.163.com + trace
; Global options: printcmd
. 223628 in ns e.root-servers.net.
. 223628 in ns f.root-servers.net.
. 223628 in ns g.root-servers.net.
. 223628 in ns h.root-servers.net.
. 223628 in ns I .root-servers.net.
. 223628 in ns j.root-servers.net.
. 223628 in ns k.root-servers.net.
. 223628 in ns l.root-servers.net.
. 223628 in ns m.root-servers.net.
. 223628 in ns a.root-servers.net.
. 223628 in ns B .root-servers.net.
. 223628 in ns c.root-servers.net.
. 223628 in ns d.root-servers.net.
[1] [2] Next page