This section describes how to configure static DNS.
As shown in Figure 1, Device A frequently uses the domain name "host.com" to visit the host. To improve the efficiency of domain name resolution, you can establish a static mapping between the domain name "host.com" and IP address 10.100.1.2 in the static domain name resolution table of Device A.
The configuration roadmap is as follows:
To complete the configuration, you need the following data:
IP addresses of Device A and the host
Domain name of the host
<HUAWEI> system-view [~HUAWEI]sysname DeviceA [*HUAWEI]commit [~DeviceA] ip host host.com 10.100.1.2 [*DeviceA] commit
<DeviceA> ping host.com
ping host.com (10.100.1.2):56 data bytes, press CTRL_C to break
Reply from 10.100.1.2: bytes=56 Sequence=1 ttl=128 time=1 ms
Reply from 10.100.1.2: bytes=56 Sequence=2 ttl=128 time=4 ms
Reply from 10.100.1.2: bytes=56 Sequence=3 ttl=128 time=3 ms
Reply from 10.100.1.2: bytes=56 Sequence=4 ttl=128 time=2 ms
Reply from 10.100.1.2: bytes=56 Sequence=5 ttl=128 time=3 ms
--- host.com ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/2/4 ms
<DeviceA> display ip host
Host Age Flags Address
host.com 0 static 10.100.1.2