Configures the Domain Name System (DNS) domain name and the primary and secondary name server IP addresses.
Global configuration mode
Your first run of ip dns name-server specifies the default IP gateway address. Your second run of ip dns name-server specifies the secondary IP gateway address.
Name servers can only be entered or removed one at a time. The newly entered name server is appended to the existing name server.
When a source interface is not specified, the default source is the IP address of the interface from which the packet egresses.
If, at run time, the source interface is not up or the IP address for the source interface was not configured, the command behaves as though the source interface was not configured.
Use the no form of the command with the domain-name parameter to disable IP-directed broadcasts for a specific domain.
Use the no form of the command with the name-server parameter to delete a name server definition.
The following example configures the DNS domain name and the primary name server IP address.
device# configure terminal device(config)# ip dns domain-name mycompany.com device(config)# ip dns name-server 10.70.20.1This example identifies an Ethernet interface as the source interface.
device# configure terminal device(config)# ip dns name-server 1.1.1.1 device(config-name-server-1.1.1.1/default-vrf)# source-interface ethernet 0/1