|
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.
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 name knows what name
server
to talk to because it can get the IP address of your machine's
name server from the operating
system.
The browser therefore contacts its
name server and says, "I need for you to convert a domain name to an IP
address for me." For example, if you type "www.mysite.com" into
your browser, the browser needs to convert that URL into an IP address.
The browser will hand "www.mysite.com" to its default name server
and ask it to convert it.
The name server may already know
the IP address for www.mysite.com. That would be the case
if another request
to resolve www.mysite.com came in recently (name servers cache IP
addresses to speed things up). In that case, the name server can
return the IP address immediately. Let's assume, however, that the
name server has to start from scratch.
A name server would start its search for
an IP address by contacting one of the root name servers.
The root servers know the IP address for all of the name servers
that handle the top-level domains. Your name server would ask the
root for www.mysite.com, and the root would say (assuming no
caching), "I
don't know the IP address for www.mysite.com, but here's the IP
address for the COM name server." Obviously, these root servers
are vital to this whole process, so:
- There are many of them scattered all
over the planet.
- Every name server has a list of all of
the known root servers. It contacts the first root server in the
list, and if that doesn't work it contacts the next one in the
list, and so on.
Here is a typical list of root servers held by a typical name server:
; This file holds the information on root name servers
; needed to initialize cache of Internet domain name
; servers (e.g. reference this file in the
; "cache . <file>" configuration file of BIND domain
: name servers).
;
; This file is made available by InterNIC registration
; services under anonymous FTP as
; file /domain/named.root
; on server FTP.RS.INTERNIC.NET
; -OR- under Gopher at RS.INTERNIC.NET
; under menu InterNIC Registration Services (NSI)
; submenu InterNIC Registration Archives
; file named.root
;
; last update: Aug 22, 1997
; related version of root zone: 1997082200
;
;
; formerly NS.INTERNIC.NET
;
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
;
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
;
; formerly C.PSI.NET
;
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
;
; 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.mysite.com.
The name server for the COM domain knows the IP addresses for the
name servers handling the mysite.com domain, so it returns those.
Your name server then contacts the name server for mysite.com and
asks if it knows the IP address for www.mysite.com. It does, so
it returns the IP address to your name server, which returns it to
the browser, which can then contact the server for www.mysite.com
to get a Web page.
One of the keys to making this work is redundancy.
There are multiple name servers at every level, so if one fails,
there are others to handle the requests. There are, for example,
three different machines running name servers for mysite.com requests.
All three would have to fail for there to be a problem.
The other key is caching.
Once a name server resolves a request, it caches all
of the IP addresses it receives. Once it has made a request to a
root server for any COM domain, it knows the IP address for a name
server handling the COM domain, so it doesn't have to bug the root
servers again for that information. Name servers can do this for
every request, and this caching helps to keep things from bogging
down.
Name servers do not cache forever, though.
The caching has a component, called the Time To Live (TTL),
that controls how long a server will cache a piece of information.
When the server receives an IP address, it receives the TTL with
it. The name server will cache the IP address for that period of
time (ranging from minutes to days) and then discard it. The TTL
allows changes in name servers to propagate. Not all name servers
respect the TTL they receive, however. When www.mysite.com moved its
machines over to new servers, it took three weeks for the transition
to propagate throughout the Web.
We put a little tag that said "new
server" in the upper left corner of the home page so people could
tell whether they were seeing the new or the old server during the
transition. |