ip dns host


ip dns host <HOST-NAME> <IP-ADDR> [ vrf <VRF-NAME> ]
no ip dns host <HOST-NAME> <IP-ADDR> [ vrf <VRF-NAME> ] 


Associates a static IP address with a hostname. The DNS client returns this IP address instead of querying a DNS server for an IP address for the hostname. Up to six hosts can be defined. If no VRF is defined, the default VRF is used.

The no form of this command removes a static IP address associated with a hostname.

Command context



host <HOST-NAME>
Specifies the name of a host. Length: 1 to 256 characters.

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.

vrf <VRF-NAME>
Specifies a VRF name. Default: default.


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


This example defines an IPv4 address of for host1.

switch(config)# ip dns host host1

This example defines an IPv6 address of b::5 for host 1.

switch(config)# ip dns host host1 b::5

This example defines removes the entry for host 1 with address b::5.

switch(config)# no ip dns host host1 b::5