Configuring the DNS client

Procedure
  1. Configure one or more DNS name servers with the command ip dns server.
  2. To resolve DNS requests by appending a domain name to the requests, either configure a single domain name with the command ip dns domain-name, or configure a list of up to six domain names with the command ip dns domain-list.
  3. To use static name resolution for certain hosts, associate an IP address to a host with the command ip dns host.
  4. Review your DNS configuration settings with the command show ip dns.

Examples

This example creates the following configuration:

  • Defines the domain switch.com to append to all requests.
  • Defines a DNS server with IPv4 address of 1.1.1.1.
  • Defines a static DNS host named myhost1 with an IPv4 address of 3.3.3.3.
  • DNS client traffic is sent on the default VRF (named default).

switch(config)# ip dns domain-name switch.com
switch(config)# ip dns server-address 1.1.1.1
switch(config)# ip dns host myhost1 3.3.3.3
switch(config)# exit
switch# show ip dns

VRF Name : vrf_mgmt

Host Name                                                        Address
--------------------------------------------------------------------------------


VRF Name : vrf_default
Domain Name : switch.com
DNS Domain list : 
Name Server(s) : 1.1.1.1

Host Name                                                        Address
--------------------------------------------------------------------------------
myhost1