Name servers do two things all day long:

• They accept requests from programs to convert domain names into IP addresses.

• They accept requests from other name servers to convert domain names into IP addresses.

When a request comes in, the name server can do one of four things with it:

• It can answer the request with an IP address because it already knows the IP address for the domain.

• It can contact another name server and try to find the IP address for the name requested. It may have to do this multiple times.
• It can say, "I don't know the IP address for the domain you requested, but here's the IP address for a name server that knows more than I do."
• It can return an error message because the requested domain name is invalid or does not exist.

When you type a URL into your browser, the browser's first step is to convert the domain name and host name into an IP address so that the browser can go request a Web page from the machine at that IP address (see How Web Servers Work for details on the whole process). To do this conversion, the browser has a conversation with a name server.

When you set up your machine on the Internet, you (or the software that you installed to connect to your ISP) had to tell your machine what name server it should use for converting domain names to IP addresses. On some systems, the DNS is dynamically fed to the machine when you connect to the ISP, and on other machines it is hard-wired. If you are working on a Windows 95/98/ME machine, you can view your current name server with the command WINIPCFG.EXE (IPCONFIG for Windows 2000/XP). On a UNIX machine, type nslookup along with your machine name. Any program on your machine that needs to talk to a name server to resolve a domain
; formerly TERP.UMD.EDU
;
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
;
; formerly NS.NASA.GOV
;
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
;
; formerly NS.ISC.ORG
;
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
;
; formerly NIC.NORDU.NET
;
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; temporarily housed at NSI (InterNIC)
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 198.41.0.10
;
; housed in LINX, operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
;
; temporarily housed at ISI (IANA)
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
;
; housed in Japan, operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
; End of File

The formatting is a little odd, but basically it shows you that the list contains the actual IP addresses of 13 different root servers.

The root server knows the IP addresses of the name servers handling the several hundred top-level domains. It returns to your name server the IP address for a name server for the COM domain. Your name server then sends a query to the COM name server asking it if it knows the IP address for www.howstuffworks.com. The name server for the COM domain knows the IP addresses for the name servers handling the HOWSTUFFWORKS.COM domain, so it returns those. Your name server then contacts the name server for HOWSTUFFWORKS.COM and asks

HowStuffWorks as well as the machine that hosted the HowStuffWorks Web pages. This type of machine is called a virtual Web hosting machine and is capable of hosting multiple domains simultaneously. Five-hundred or so different domains all shared the same processor.

As HowStuffWorks became more popular, it outgrew the virtual hosting machine and needed its own server. At that point, we started maintaining our own machines dedicated to HowStuffWorks, and began administering our own DNS. We have a primary server and a secondary:

• AUTH-NS1.HOWSTUFFWORKS.COM 209.116.69.78

• AUTH-NS2.HOWSTUFFWORKS.COM 209.116.69.79

Our primary DNS is auth-ns1.howstuffworks.com. Any changes we make to it propagate automatically to the secondary, which is also maintained by our ISP.

All of these machines run name server software called BIND. BIND knows about all of the machines in our domain through a text file on the main server that looks like this:

@ NS auth-ns1.howstuffworks.com.
@ NS auth-ns2.howstuffworks.com.
@ MX 10 mail
mail A 209.170.137.42
vip1 A 216.183.103.150
www CNAME vip1

Decoding this file from the top, you can see that:

• The first two lines point to the primary and secondary name servers.

• The next line is called the MX record. When you send e-mail to anyone at howstuffworks.com, the piece of software sending the e-mail contacts the name server to get the MX record so it knows where the SMTP server for HowStuffWorks is (see How E- mail Works for details). Many larger systems have multiple machines handling incoming e-mail, and therefore multiple MX records.

• The next line points to the machine that will handle a request to mail.howstuffworks.com.
• The next line points to the IP address that will handle a request to oak.howstuffworks.com.
• The next line points to the IP address that will handle a request to howstuffworks.com (no host name).

You can see from this file that there are several physical machines at separate IP addresses that make up the HowStuffWorks server infrastructure. There are aliases for hosts like mail and www. There can be aliases for anything. For example, there could be an entry in this file for scoobydoo.howstuffworks.com, and it could point to the physical machine called walnut. There could be an alias for yahoo.howstuffworks.com, and it could point to yahoo. There really is no limit to it. We could also create multiple name servers and segment our domain.

The Beauty of DNS

As you can see from this description, DNS is a rather amazing distributed database. It handles billions of requests for billions of names every day through a network of millions of name servers administered by millions of people. Every time you send an e-mail message or view a URL, you are making requests to multiple name servers scattered all over the globe. What's amazing is that the process is usually completely invisible and extremely reliable!
 


Blogger Template By LawnyDesigns