ip dns server address

Syntax

ip dns server-address <IP-ADDR> [ vrf <VRF-NAME> ] 

no ip dns server-address <IP-ADDR> [ vrf <VRF-NAME> ]

Description

Configures the DNS name servers that the DNS client queries to resolve DNS queries. Up to six name servers can be defined. The DNS client queries the servers in the order that they are defined. If no VRF is defined, the default VRF is used.

The no form of this command removes a name server from the list.

Command context

config

Parameters

<IP-ADDR>

Specifies an IP address in IPv4 format (x.x.x.x), where x is a decimal number from 0 to 255, or IPv6 format (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx), where x is a hexadecimal number from 0 to F.

When specifying an IPv4 address, you can remove leading zeros. For example, the address 192.169.005.100 becomes 192.168.5.100.

When specifying an IPv6 address, you can use two colons (::) to represent consecutive zeros (but only once), remove leading zeros, and collapse a hextet of four zeros to a single 0. For example, this address 2222:0000:3333:0000:0000:0000:4444:0055 becomes 2222:0:3333::4444:55.

vrf <VRF-NAME>
Specifies the VRF on which to send queries to the name servers. The VRF must be defined on the switch. If no VRF is specified, the default VRF is used.

Authority

Administrators

Examples

This example defines a name server at 1.1.1.1.

switch(config)# ip dns server-address 1.1.1.1
This example defines a name server at 1.1.1.2 using mainvrf.
switch(config)# ip dns server-address 1.1.1.2 vrf mainvrf
This example defines a name server at a::1.
switch(config)# ip dns server-address a::1
This example removes a name server at a::1.
switch(config)# no ip dns server-address a::1