< Home

ip host

Function

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.

Format

ip host host-name ip-address

undo ip host host-name [ ip-address ]

Parameters

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.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

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.

Example

# Configure the IP address 10.110.0.1 for the host test.

<sysname> system-view
[sysname] ip host test 10.110.0.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >