Configuring the DNS client

Procedure
  1. Configure one or more DNS name servers with the commandip dns server.
  2. To resolve DNS requests by appending a domain name to the requests, either configure a single domain name with the commandip dns domain-name,或者配置6个域名wi的列表th the commandip dns domain-list.
  3. To use static name resolution for certain hosts, associate an IP address to a host with the commandip dns host.
  4. Review your DNS configuration settings with the commandshow ip dns.

Examples

This example creates the following configuration:

  • Defines the domainswitch.comto append to all requests.
  • Defines a DNS server with IPv4 address of1.1.1.1.
  • Defines a static DNS host namedmyhost1with an IPv4 address of3.3.3.3.
  • DNS client traffic is sent on the default VRF (nameddefault).

switch(config)#ip dns domain-name switch.comswitch(config)#ip dns server-address 1.1.1.1switch(config)#ip dns host myhost1 3.3.3.3switch(config)#exitswitch#show ip dnsVRF 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