How Resolution Works
Very important to learning and manipulating DNS is a way to get from one zone to another. This mechanism is vital to DNS—it is essential that you understand moving between zones and how important it is, because it will help you solve a lot of the DNS problems you encounter. Many of the questions about DNS found in Internet forums stem from not understanding this linkage and the importance of it being all there and working.
DNS is like a tree data structure used in programs. It has a root node, and it has edges to descend the tree from the root to other nodes and find the data requested.
When a piece of software requests a piece of information from DNS, it specifies two things: the RR—or resource record—type (what kind of information it needs), and the domain name of the record (in database language) and the lookup key.
To find the address of www.amazon.com, the DNS system specifies that it wants the A (address) record for www.amazon.com. There are software tools to do such lookups on the command line and display the results. I will use dig, which is a very powerful DNS tool. Unfortunately, dig is not ubiquitous, but it is the best I know for this task. When you have installed a new BIND, you will also have dig.
In all computer listings in this book, the $ sign or # hash indicates a shell command-line prompt, as traditional in Unix texts.
First, you use dig to find the A record for www.amazon.com:
$ dig www.amazon.com A ; <<>> DiG 8.2 <<>> www.amazon.com A ;; res options: init recurs defnam dnsrch ;; got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0 ;; QUERY SECTION: ;; www.amazon.com, type = A, class = IN ;; ANSWER SECTION: www.amazon.com. 1M IN A 220.127.116.11 ;; AUTHORITY SECTION: www.amazon.com. 1S IN NS ns-10.amazon.com. ;; Total query time: 5248 msec ;; FROM: roke.uio.no to SERVER: default -- 127.0.0.1 ;; WHEN: Tue Feb 29 20:50:22 2000 ;; MSG SIZE sent: 32 rcvd: 78
If you look through all that verbiage, you find what you asked for, as well. In the ANSWER SECTION, you see that www.amazon.com has an A record and that the address is 18.104.22.168.