Troubleshooting TCP/IP Application Layer Protocols
Name resolution

There are many DNS servers throughout the Internet. However, each DNS server stores only a portion of the entire Internet namespace. A DNS hierarchy enables DNS servers to find their neighbors and ask each other for information about a specific host.

A domain is a label in the DNS hierarchy. Each node in the DNS hierarchy represents a domain. Domains under the top-level domains represent individual organizations or entities. These domains can be further divided into subdomains to ease administration of an organization's host computers.

Top-level domain names are part of most URLs. For example, ".com," ".edu," ".net," ".gov," and ".org" are top-level domain names. These top-level domains contain the basis for the rest of the domain naming structure. Individual organizations are granted second-level domain names within one or more of these top-level domains. Because names have to be unique in a domain, they must be registered.

When an organization wishes to acquire a second-level domain name, it must submit a request to one of the Registrars accredited by the Internet Corporation for Assigned Names and Numbers (ICANN). If the domain name is available and the Registrar does not have a problem with the name, it is assigned to the organization in exchange for a fee. The organization itself is responsible for assigning third-level and lower domains.

How DNS is Resolved
In Figure , the client makes a request to the corporate DNS server. The DNS server checks its cache to see if the query has already been resolved. In this situation, the corporate DNS server has no record of this query. Therefore, the corporate DNS switches roles and now acts as a client and issues an iterative query to the local ISP.

The ISP name server has no record of this resolved request. The ISP server replies back with a hint to query the root domain server.

The DNS server issues an iterative query at the top of the DNS hierarchy to the root level server. After each query and response the server goes down the DNS tree until it finally finds the correct resolved name.

Nslookup
The most effective command for testing and resolving DNS issues is the nslookup command.

If the lookup request fails, nslookup prints an error message. Figure lists possible error messages.

DNS and Routers
A router can be configured to use DNS lookups so that ping or traceroute commands can be used with a hostname rather than an IP address. Use the commands in Figure to do so.