Image Show
Name resolution is the process of relating easy-to-remember names with difficult-to-remember Internet Protocol (IP) addresses. The Domain Name System (DNS) provides name resolution services in most environments. These internal servers host a dynamic database of names and related IP addresses. These names may be as simple as hostnames or as complex as fully qualified domain names and web URLs. DNS servers host resource records, such as start of authority (SOA), name server (NS), and mail exchange (ME). The two most common record types are A and pointer records (PTR). The A records service forwards lookup requests, specifying that a given name is related to a particular IP address. PTR maps an IP address to a particular name. When a forward lookup query arrives, it is serviced by the A record for that name. When a reverse lookup query arrives, the PTR for that IP address services it. What might make you suspect a name resolution problem? Perhaps a user comments that they can no longer reach a resource such as a file server or printer, or an email server seems unavailable. Users may experience intermittent difficulty accessing an internal web server or related service. Perhaps users can connect to a server, but it isn't the correct server, so an unexpected web page is displayed. Because there are many types of name servers, especially in large networks, it can be difficult to determine the culprit. When troubleshooting, it can be useful to query specific name servers and examine their administrative resource records. Install the toolsThis article compares four useful tools for testing name resolution on your Linux systems:
Before you begin, ensure the commands are installed. The
How to use pingThe basic First, test connectivity by hostname, assuming a remote host named server01 with an IP address of 192.168.1.101:
If this succeeds and name resolution works, you probably don't need to continue along this line of testing. If this test fails, try the
If this works, connectivity exists. Name resolution is the problem since that's where the failure appears. Now you can begin troubleshooting why the system isn't resolving names properly. If the Ping helps you narrow down whether you have a name resolution issue or something else is happening. [ Keep common commands close at hand. Download the Linux commands cheat sheet. ] How to use nslookupThe
In non-interactive mode, simply type
This output should display the IP address for server01, along with information about which server resolves the name. If this fails, it indicates a name resolution problem. Perform a reverse lookup (resolving a known IP address to an unknown name) by typing:
To see specific resource record types, use the
Many administrators work on multiple platforms. Nslookup is notable for being preinstalled on Microsoft Windows, which means you can learn one troubleshooting tool and use it on two platforms. How nslookup comparesNslookup
is the oldest of the three tools and has been on the deprecation chopping block at least once. However, it's still around. One concern about How to use digLike the other commands in this article, Generate forward lookups like this:
Initiate a reverse lookup by using the
Query the name server for specific record types by appending the type to the command:
This resolves the mail server for the example.com domain name. As you can see, similar functionality exists within [ Learn how to manage your Linux environment for success. ] How dig comparesUsing How to use hostDoing manual name resolutions with the Here is the basic syntax for a forward lookup:
Here's the syntax for a reverse lookup:
Querying for SOA records relies on the
The
If you're not sure which record types you need or if you want to see them all, use the
To
narrow the query's scope to either IPv4 or IPv6 records, add the Like How host comparesAdministrators may prefer Wrapping upTo some degree, Some command options require a DNS zone transfer, which often is not allowed by the DNS server. Be aware of this, particularly for external name resolution servers or other DNS servers you don't manage. Finally, don't forget that Which of the following command can be used to refresh the DNS records on a host device?The ipconfig /flushdns command clears the local cache of DNS entries.
What is a single DNS server called that has a list of all the domain hosts names and their corresponding IP addresses?Chapter 10 networkin. What type of resource record is an alias for another record?A Canonical Name record (abbreviated as CNAME record) is a type of resource record in the Domain Name System (DNS) that maps one domain name (an alias) to another (the canonical name).
What DNS record type is used to resolve a known IP address to a hostname?Name Server records (NS Record)—specifies that a DNS Zone, such as “example.com” is delegated to a specific Authoritative Name Server, and provides the address of the name server. Reverse-lookup Pointer records (PTR Record)—allows a DNS resolver to provide an IP address and receive a hostname (reverse DNS lookup).
|