next up previous contents index
Next: CNAME Up: Networking Basics Previous: Routers   Contents   Index

Domain Name Servers

We mentioned before about how hard it is to remember a machines IP address. In order to be able to forget the IP address we use hostnames instead. The Domain Name Servers is like a phone book where you can look up IP addresses by giving the hostname. You can use the nslookup and dig commands to look-up IP addresses from the shell. Here are some examples:

bash$ nslookup www.osdn.com -silent
Server:		64.75.142.2
Address:	64.75.142.2#53

Non-authoritative answer:
www.osdn.com	canonical name = osdn.com.
Name:	osdn.com
Address: 64.28.67.20

With nslookup you get back the DNS server you used and the port that server was at. You then find out that www.osdn.com is just an alias to the real name of osdn.com. The name osdn.com points to the IP address 64.28.67.20. So you found the IP address. Now let's try dig.

bash$ dig www.osdn.com

; <<>> DiG 9.1.0 <<>> www.osdn.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12056
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.osdn.com.			IN	A

;; ANSWER SECTION:
www.osdn.com.		17709	IN	CNAME	osdn.com.
osdn.com.		17709	IN	A	64.28.67.20

;; AUTHORITY SECTION:
osdn.com.		17709	IN	NS	ns2.andover.net.
osdn.com.		17709	IN	NS	ns1.andover.net.

;; ADDITIONAL SECTION:
ns1.andover.net.	104109	IN	A	64.28.67.55
ns2.andover.net.	104109	IN	A	209.192.217.105

;; Query time: 24 msec
;; SERVER: 64.75.142.2#53(64.75.142.2)
;; WHEN: Tue Feb 26 10:30:50 2002
;; MSG SIZE  rcvd: 139

The dig command gives back more information than most people can easily understand. One way to start is to skip all of the lines that start with a semicolon. The semicolon lines are not very important. The data that comes back looks much like the format of a DNS configuration file. The first uncommented line is the one that says that www.osdn.com is an alias to osdn.com. The next line says that osdn.com points to 64.28.67.20. The next four uncommented lines tell you which DNS to talk to to get current correct information.



Subsections
next up previous contents index
Next: CNAME Up: Networking Basics Previous: Routers   Contents   Index
Joseph Colton 2002-09-24