Configuring the DNS client
Procedure
- Configure one or more DNS name servers with the command
ip dns server
. - 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
,或者配置6个域名wi的列表th the commandip dns domain-list
. - To use static name resolution for certain hosts, associate an IP address to a host with the command
ip dns host
. - Review your DNS configuration settings with the command
show 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