nameserver

Syntax

nameserver <PRIMARY-IP-ADDR> [ <SECONDARY-IP-ADDR> ]

no nameserver <PRIMARY-IP-ADDR> [ <SECONDARY-IP-ADDR> ]

Description

Assigns a primary or secondary IPv4 or IPv6 DNS server to the management interface. IPv4 DNS servers can only be configured if a static IPv4 address was assigned to the management interface. IPv6 DNS servers can only be configured if a static IPv6 address was assigned to the management interface. The default gateway should be on the same network segment.

The no form of this command removes the DNS servers from the management interface.

Command context

config-if-mgmt

Parameters

<PRIMARY-IP-ADDR>

Specifies the IP address of the primary DNS server. Specify the 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.

<SECONDARY-IP-ADDR>

Specifies the IP address of the secondary DNS server. Specify the 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.

Authority

Administrators or local user group members with execution rights for this command.

Examples

Setting primary and secondary DNS servers with the IPv4 addresses of 198.168.5.1 and 198.168.5.2 :

switch(config)# interface mgmt
switch(config-if-mgmt)# nameserver 198.168.5.1 198.168.5.2

Setting primary and secondary DNS servers with the IPv6 addresses of 2001:DB8::1 and 2001:DB8::2:

switch(config)# interface mgmt
switch(config-if-mgmt)# nameserver 2001:DB8::1 2001:DB8::2