ip dns host
Syntax
ip dns host [ vrf ] no ip dns host [ vrf ]
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.
Theno
form of this command removes a static IP address associated with a hostname.
Command context
config
Parameters
-
host
- 指定了主机的名称。长度:cha 1到256racters.
-
-
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
- 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 of3.3.3.3forhost1.
switch(config)#ip dns host host1 3.3.3.3
This example defines an IPv6 address ofb::5forhost 1.
switch(config)#ip dns host host1 b::5
This example defines removes the entry forhost 1with addressb::5.
switch(config)#no ip dns host host1 b::5