DNS Conceptual Overview

When you type http://www.nolug.orgin Netscape, Netscape needs to first find out just where in the heck www.nolug.org is. This process is called "name resolution."

On a typical Linux setup, Netscape first takes a look inside /etc/hosts to see if there is an IP address for www.nolug.org listed there. If there's not, Netscape then typically looks at /etc/resolv.conf to find the name of your ISP's nameservers. [1]

Your ISP's nameservers then check their own cache of name-IP mappings to see if www.nolug.org exists there. If not, they send a query out to one of the nameservers designated as a root nameserver. The root nameservers then tell your ISP's nameserver the IP address of the nameserver which actually has the mapping for www.nolug.org. In this case ns1.scottharney.com at 24.216.138.9 is the machine that knows exactly where www.nolug.org is. It returns this information to your ISP's nameserver which then passes it on to your machine and netscape processes the request.

All this talk of nameservers probably has you wondering what a nameserver is. A nameserver is a piece of software, such as BIND, that runs on a machine that serves know other purpose but to resolve names to IP addresses. The server programs listens on port 53 for requests. [2] For those who didn't quite understand that last statement, you just need to know that "port 53" is an endpoint for connections which the internet gods (via RFC's[3]) have decided is the place where name requests should come in to a box across the network. Web servers and mail servers listen on other designated ports numbers.

A nameserver keeps a database of domain names and machines that it is considered authoritative for. Those that it is not authoritative for, it looks up via the root nameservers. A machine is considered authoritative for a domain when the domain name (ie. nolug.org) is registered with a DNS registrar like www.networksolutions.com or www.joker.com . That registration record will tell you what nameservers are considered authoritative for a given domain.

Finding out about nolug.org

It probably wouldn't hurt to look at a real-world sample now. Get yourself to a command prompt and type whois nolug.org.


$ whois nolug.org

Whois Server Version 1.1

Domain names in the .com, .net, and .org domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

   Domain Name: NOLUG.ORG
   Registrar: BULKREGISTER.COM, INC.
   Whois Server: whois.bulkregister.com
   Referral URL: www.bulkregister.com
   Name Server: NS1.SCOTTHARNEY.COM
   Name Server: NS2.SCOTTHARNEY.COM
   Updated Date: 18-aug-2000


>>> Last update of whois database: Tue, 22 Aug 00 04:26:52 EDT <<<

The Registry database contains ONLY .COM, .NET, .ORG, .EDU domains and
Registrars.


Found InterNIC referral to whois.bulkregister.com.

New Orleans Linux Users Group (NOLUG-ORG-DOM)
   617 Glenwood Drive
   Metairie, Louisiana 70001
   US

   Domain Name: NOLUG.ORG

   Administrative Contact:
        Tim Coston  (TC520-BR)  tim@coston.net
        Coston Enterprises, Inc.
        617 Glenwood Drive
        Metairie, Louisiana 70001
        US
        Phone- 504-723-6095 
        Fax- 
   Technical Contact:
        Hunter Hutchinson  (HH419-BR)  vex@unixpunk.dhs.org
        NOLUG
        1025 N. Hullen
        Metairie, Louisiana 70001
        US
        Phone-  
        Fax- 

   Record updated on 2000-06-30.
   Record created on 2000-06-30.
   Record expires on 2002-06-30.
   Database last updated on 2000-08-22 03:54:53 EST.

   Domain servers in listed order:

   NS1.SCOTTHARNEY.COM           24.216.138.9                  
   NS2.SCOTTHARNEY.COM           24.216.138.176                
Tim Coston has created this registration at http://www.bulkregister.com . He's set up a couple of contacts and he's designated NS1.SCOTTHARNEY.COM and NS2.SCOTTHARNEY.COM as his nameservers.

Of course I told him to use those two nameservers as I happen to manage them and can set up the appropriate information to map *.nolug.org names to their IP address locations.

I registered those two nameservers with Network Solutions when I set up my domain www.scottharney.com. (do a whois on it) You can look up these records by doing:
$ whois -h whois.networksolutions.com host ns1.scottharney.com

The Data in Network Solutions' WHOIS database is provided by Network
Solutions for information purposes, and to assist persons in obtaining
information about or related to a domain name registration record.
Network Solutions does not guarantee its accuracy.  By submitting a
WHOIS query, you agree that you will use this Data only for lawful
purposes and that, under no circumstances will you use this Data to:
(1) allow, enable, or otherwise support the transmission of mass
unsolicited, commercial advertising or solicitations via e-mail
(spam); or  (2) enable high volume, automated, electronic processes
that apply to Network Solutions (or its systems).  Network Solutions
reserves the right to modify these terms at any time.  By submitting
this query, you agree to abide by this policy.
[No name] (NSP3028-HST)

   Hostname: NS1.SCOTTHARNEY.COM
   Address: 24.216.138.9
   System: ? running ?

   Coordinator:
      Harney, Scott  (SHI357)  scott_harney@YAHOO.COM
      Charter
      60097 Highway 11
      Slidell, LA 70458
      504-645-0229

   Record last updated on 14-Aug-2000.
   Database last updated on 22-Aug-2000 07:39:39 EDT.
To register a host (nameserver) with a DNS registrar you need to satisfy two prerequisistes. 1) No one else has already staked their claim by registering the IP address as a host and 2) You own the domain name that you are registering the host under. It's expected that nameserver hosts have permanent connections to the internet and are running nameserver software. It's advised that the being dispersed both geographically and on the network if at all possible; the whole point of having a secondary nameserver is backup in case the primary fails.

If you haven't read the whois (1) man page yet then stop right now and read it.

Notes

[1]

read man 5 nsswitch.conf and the contents of /etc/nsswitch.confto find out the order your Linux box uses to resolve names.

[2]

see /etc/services for other port information.

[3]

Requests For Comments