ip dns

Configures the Domain Name System (DNS) domain name and the primary and secondary name server IP addresses.

Syntax

ip dns { domain-name domain-name | name-server ip-address-of-name-server }
no ip dns { domain-name domain-name | name-server ip_address_of_name_server }

Parameters

domain-name domain-name
Specifies the DNS domain name.
name-server ip-address-of-name-server
Specifies the IP address of the name server. IPv6 and IPv4 addresses are supported.

Modes

Global configuration mode

Usage Guidelines

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 will append to the existing name server.

The no form of the command with the domain-name parameter disables IP directed broadcasts for a specific domain

The no form of the command with the name-server parameter deletes a name server definition.

Examples

The following example configures the DNS domain name and the primary name server IP address.

device(config)# ip dns domain-name mycompany.com 
device(config)# ip dns name-server  10.70.20.1