The ip host command configures static DNS entries.
The undo ip host command deletes static DNS entries.
By default, no static DNS entries are configured.
| Parameter | Description | Value |
|---|---|---|
host-name |
Specifies the host name. |
The value is a string of 1 to 255 case-sensitive characters without spaces. It can contain digits, letters, underscores (_), periods (.), and hyphens (-), and must contain letters. |
ip-address |
Specifies the IP address mapping the host name. |
The value is in dotted decimal notation. |
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 multiple IP addresses are mapped to a host name, only the latest configuration takes effect.