Hostnames and Domain Names


Now that you have an understanding of the way MAC addresses and IP addresses work, you can apply yet another layer of indirection to the host-finding process: hostnames and the Domain Name System (DNS). Hostnames assign human-readable names to machines that otherwise would only be identifiable by their IP addresses, and DNS is the mechanism by which those names are assigned.

Early in TCP/IP history, different networked machines were identifiable only by their IP addresses. This worked really well, until the number of online people grew so large that keeping track of all the numbers involved was tedious and error-pronenobody wanted to have to keep huge lists of IP addresses and what they all referred to. Hence the introduction of the Domain Name System, a means of assigning common names to IP addresses, resulting in the much easier-to-use system you know today.

DNS records are kept in a centralized database on multiple root serversthe 13 "master" name servers that hold the definitive DNS information for all the Internetthat are maintained at various disparate corporate and university locations around the United States. These servers take their information from the DNS hosts they have designated as authoritative for any given domain name (for instance, example.com). Each domain's authoritative DNS keeps the records in a database of its own, which varies from implementation to implementation. FreeBSD, like most UNIXes, uses BIND, which keeps its records in /var/named/etc/namedb. We will discuss how to set up DNS on FreeBSD in Chapter 32, "The Domain Name Server."

Within a domain, every machine listed in the domain's DNS records has a hostname, or a simple machine name such as tiger or pluto. Combined with the domain, this results in a fully qualified domain name (FQDN), such as tiger.example.com.

Note

It is also possible for a domain name to be fully qualified without a subdomain or hostname attached. The hostname example.com is a fully qualified domain name, and a machine's IP address can be assigned to it.


What's important to understand for networking purposes is that the hierarchical structure of the domain name, hostname, and FQDN have no bearing on the hierarchical addressing conventions in IP addresses. The example.com domain can have hosts with IP addresses all over the mapthe DNS configuration just needs to point to them correctly. For instance, www.example.com can be 64.41.131.45, and ftp.example.com can be 213.11.31.221; it doesn't matter as far as TCP/IP is concerned. DNS is completely outside the TCP/IP stack.

Where DNS does come into play is at the application level, in which the hostname is used as an easier interface for the user than a bare IP address. A web browser, for example, takes a DNS name and passes it to the operating system, which translates it into an IP address transparently before it even tries to connect to the requested host. To put it into the terms we've been using throughout this chapter, the abstraction that DNS provides over IP addresses is analogous to the abstraction that IP addresses provide over MAC addresses. Just as ARP associates IP and MAC addresses for use by the data link layer, a name lookup associates hostnames and IP addresses for use by the network layer.




FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net