r1(config)#ip dns server
(使路由器‘成为DNS服务器’)
r1(config)#ip host ?
WORD Name of host
r1(config)#ip host r1 ?
<0-65535> Default telnet port number
A.B.C.D Host IP address
additional Append addresses
mx Configure a MX record
ns Configure an NS record
srv Configure a SRV record
r1(config)#ip host r1 192.168.1.1
r1(config)#ip host r2 192.168.1.2
(在DNS服务器上,创建‘解析条目’)
r2(config)#ip name-server 192.168.1.1
(设置DNS服务器,也即指向DNS服务器IP)
r2#telnet r1
(执行telnet命令,进行检测)
Translating "r1"...domain server (192.168.1.1) [OK]
Trying r1 (192.168.1.1)... Open
User Access Verification
Password:
r1>en
Password:
r1#
(连接成功,也即‘解析’成功;
前提是,必须设置‘enable password以及vty password’;)