Configure a DNS Domain and Gateway Addresses

You can configure a Domain Name System (DNS) domain and DNS gateway addresses to resolve host names to IP addresses.

Procedure

  1. Access global configuration mode.
    device# configure terminal
  2. Configure a domain name.
    device(config)# ip dns domain-list mycompany.com
  3. Configure the default DNS gateway address for DNS servers.
    device(config)# ip dns name-server 10.157.22.199
    
  4. Return to privileged EXEC mode.
    device(config)# exit
    
  5. (Optional) Verify the DNS configuration.
    device# traceroute mycompany.com
    
    Sending DNS Query to 10.157.22.199
    Tracing Route to IP node 10.157.22.80
    To ABORT Trace Route, Please use stop-traceroute command.
     Traced route to target IP node 10.157.22.80:
      IP Address    Round Trip Time1    Round Trip Time2
      10.95.6.30    93 msec             121 msec
    
    The output shows that 10.157.22.199 is the IP address of the DNS server (default DNS gateway address), and 10.157.22.80 represents the IP address of the mycompany.com host.

Example

The following example configures a DNS domain and default and secondary DNS gateway addresses for DNS servers

device# configure terminal
device(config)# ip dns domain-name www.mycompany.com
device(config)# ip dns name-server 10.157.22.199
device(config)# exit
device(config)# ip dns name-server 10.96.7.15