Guest

IP Application Services

DNS on a Host Configuration Example

Cisco - DNS on a Host Configuration Example

Document ID: 10823

Updated: Oct 05, 2005

   Print

Introduction

This document describes how to configure a Domain Naming System (DNS) on a host.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

The information in this document is based on the software and hardware versions:

  • Solaris 2.6, 2,7, 2.8 and 2.9

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.

Conventions

For more information on document conventions, see the Cisco Technical Tips Conventions.

Configuring DNS

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:

  • resolv.conf

  • nsswitch.conf

Follow the instructions provided below:

  1. Verify that the content of the /etc/resolv.conf file is comparable to the following:

    domain cisco.com
    nameserver 172.20.2.77
    nameserver 172.20.3.40
    1. 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.

    2. 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.

  2. Verify that the content of the /etc/nsswitch.conf file is comparable to the following:

    # /etc/nsswitch.files:
    
    #
    
    # 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. 
    
    passwd: files
    
    group: files 
    
    hosts: files dns
    
    networks: files 
    
    protocols: files 
    
    rpc: files
    
    ethers: files 
    
    netmasks: files 
    
    bootparams: files 
    
    publickey: files 
    
    # 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. 
    
    netgroup: files
    
    automount: files 
    
    aliases: files
    
    services: files
    
    sendmailvars: files

    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.

  3. 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.

Related Information

Updated: Oct 05, 2005
Document ID: 10823