ip dns host
Syntax
ip dns host <HOST-NAME> <IP-ADDR> [ vrf <VRF-NAME> ]
no ip dns host <HOST-NAME> <IP-ADDR> [ vrf <VRF-NAME> ]
Description
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
config
Parameters
host <HOST-NAME>
- Specifies the name of a host. Length: 1 to 256 characters.
<IP-ADDR>
Specifies an IP address in IPv4 format (
x.x.x.x
), wherex
is a decimal number from 0 to 255, or IPv6 format (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
), wherex
is a hexadecimal number from 0 to F.vrf <VRF-NAME>
- Specifies a VRF name. Default: default.
Authority
Administrators or local user group members with execution rights for this command.
Examples
This example defines an IPv4 address of 3.3.3.3 for host1.
switch(config)# ip dns host host1 3.3.3.3
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