The ip host command configures a static DNS entry.
The undo ip host command deletes a static DNS entry.
By default, no static DNS entry is configured.
ip host host-name ip-address [ vpn-instance vpn-instance-name ]
undo ip host host-name [ ip-address [ vpn-instance vpn-instance-name ] ]
Parameter |
Description |
Value |
---|---|---|
host-name |
Specifies the host name. |
The value is a string of 1 to 255 case-sensitive characters without any space. The value must contain at least one letter, and can consist of letters, digits, hyphens (-), dots (.), and underscores (_). |
ip-address |
Specifies the IP address mapping the host name. |
The value is in dotted decimal notation. |
vpn-instance vpn-instance-name |
Specifies the name of a VPN instance. |
The value must be an existing VPN instance name. |
Usage Scenario
A static domain name resolution table is manually set up using the ip host command, describing the mappings between host names and IP addresses. In addition, some common host names are added to the table. Then, static host name resolution can be performed according to the static domain name resolution table. When requiring the IP address corresponding to a host name, the client first searches the static host name resolution table for the specified host name and obtains the corresponding IP address. In this manner, the efficiency of host name resolution is improved.
Precautions
The ip host command configures a maximum of 50 static DNS entries. Each host name can be mapped to only one IP address. When one host name is mapped to multiple IP addresses, only the latest configuration takes effect.