[R1]ping PC1 Ping PC1 (192.168.0.1): 56 data bytes, press CTRL_C to break 56 bytes from 192.168.0.1: icmp_seq=0 ttl=254 time=3.000 ms 56 bytes from 192.168.0.1: icmp_seq=1 ttl=254 time=1.000 ms 56 bytes from 192.168.0.1: icmp_seq=2 ttl=254 time=1.000 ms 56 bytes from 192.168.0.1: icmp_seq=3 ttl=254 time=3.000 ms 56 bytes from 192.168.0.1: icmp_seq=4 ttl=254 time=1.000 ms
# 开启动态域名解析功能。 <Sysname> system-view [Sysname] dns resolve
# 配置域名服务器的IP地址为2.1.1.2。 [Sysname] dns server 2.1.1.2
# 配置域名后缀com。 [Sysname] dns domain com
测试
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# 在设备上执行ping host命令,可以ping通主机,且对应的目的地址为3.1.1.1。 [Sysname] ping host Trying DNS resolve, press CTRL_C to break Trying DNS server (2.1.1.2) PING host.com (3.1.1.1): 56 data bytes, press CTRL_C to break Reply from 3.1.1.1: bytes=56 Sequence=1 ttl=126 time=3 ms Reply from 3.1.1.1: bytes=56 Sequence=2 ttl=126 time=1 ms Reply from 3.1.1.1: bytes=56 Sequence=3 ttl=126 time=1 ms Reply from 3.1.1.1: bytes=56 Sequence=4 ttl=126 time=1 ms Reply from 3.1.1.1: bytes=56 Sequence=5 ttl=126 time=1 ms --- host.com ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/3 ms