This document describes how to configure a Domain Naming System (DNS) on a host.
There are no specific requirements for this document.
The information in this document is based on the software and hardware versions:
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
For more information on document conventions, see the Cisco Technical Tips Conventions.
This section describes the procedure to configure DNS on a host. Before you begin, verify that the following files exist in the /etc directory on your Sun host:
Follow the instructions provided below:
Verify that the content of the /etc/resolv.conf file is comparable to the following:
Verify that a DNS server(s) is reachable from the host by using the ping command.
Refer to the online documentation for more information on the ping command.
Verify your domain name is correct.
For resiliency, more than one DNS server can be employed. The first DNS server declared in the resolv.conf file is the default DNS.
Verify that the content of the /etc/nsswitch.conf file is comparable to the following:
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
hosts: files dns
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
Modify the hosts: files dns line.
Each line in this table specifies which lookup method will be used first. For host name resolution, files refers to /etc/hosts and dns refers to DNS . The order is important, in this example, files is used first to attempt the name resolution. If that fails, the second method—dns—is used. The /etc/resolv.conf file is read to know what DNS servers needs to be consulted for that name resolution request.
Use the nslookup command to verify that the DNS configuration is working correctly.
Refer to the online documentation for more information on the nslookup command.
Use the nslookup command to ensure that the IP address of a host in your network is resolved to the correct address. Report any inconsistencies to the DNS administrators immediately.