 |
Most of the websites, ssh connections, and SFTP servers that you can connect to on the
Internet are known to you by a hostname, such as
umd.edu. However, the Internet does not really use these hostnames to
access such sites.
The set of rules for communicating on the Internet, Internet
Protocol, or IP, calls for the machines hosting these sites to
be referred to by a specific IP addresses, which is in a numeric form
consisting of 4 sets of numbers separated by periods. For
example: 128.8.76.2
So if you issue an Internet service request (e.g., requesting a web page, or a ssh
connection, or an sftp service) with a hostname, the hostname somehow must be
translated into its numeric IP form, and until that occurs, your
"real" request cannot be sent out.
Finding this address is the responsibility of the machines in the world-wide
Domain Name Service hierarchy, or DNS.
A domain is a name representing the institution, organization, person, or company that
paid to register that name with the Internet Network Information Center,
InterNIC. Examples include:
- whitehouse.gov - The White House
- umd.edu - The University of Maryland
- washingtonpost.com - The Washington Post
Whoever provides Internet service for a domain provides it with one or more IP
addresses. The University of Maryland, for example, has many IP addresses in blocks within
two numeric ranges that start with 128.8. and 129.2. and several others.
It is a policy of the University to have a hostname associated with each IP address
that is in use. This is not an Internet requirement, however, and many domains do not do
so. A good example of this would be an Internet Service Provider(ISP) that provides
internet service in which each customer gets temporarily assigned an IP address from a pool
of addresses maintained by the ISP. If the ISP is rapidly expanding and is constantly adding new
blocks of addresses, it may choose not to take the trouble of giving each address an
actual hostname.
The DNS is a world-wide hierarchy of machines called domain name
servers whose job it is to provide IP-address and hostname information. The
first step in that hierarchy, and the one with which you have the most contact, is your
local domain name server. It has two main jobs:
- It is the first level of IP-address help for Internet service
requests coming from you and others within your domain -- .umd.edu in
our case here at the University of Maryland.
- It is also the final authorized source of information for
all requests for IP addresses and hostnames that fall within in your
domain, whether the requests come from you and others within your domain, or from
others outside your domain.
(Note: if you look at the network configuration for your machine, you'll notice that
the DNS(s) are specified only in their IP-numeric form, never by their hostname.)
So, when you make an Internet service request (web, SSH, sftp, etc) using a
hostname, here's what happens -- a process normally taking only a second or less:
- If the hostname you're trying to reach is in your local domain, the domain lookup
stops right there at your local DNS and you get the address.
- If the hostname isn't in your local domain, your local DNS will
look in its cache -- a constantly updated list of recently accessed
outside addresses which it saves just in case such addresses are needed again
soon. If the hostname isn't in the cache, your local DNS passes the hostname up to
the next level of the hierarchy.
- If that next level knows which local DNS in the world is authorized to handle the
hostname's domain, it will pass the name to that machine to get the numeric IP
address.
- On the other hand, if this level doesn't know who to turn the hostname over to for
an answer, the hostname is passed up to the next level, and so on.
- Eventually, the local DNS that is authorized to handle the hostname's domain is
identified, and the request is passed to it.
- That local DNS then passes the desired IP address back.
- If no DNS can be found that is authorized for the hostname's domain, or if the
authorized DNS for that domain does exist but declares that the hostname doesn't
exist, a message such as Host not found or The server does not have a
DNS entry is returned instead of the IP address.
|