现在有一台服务器dbprod126,ip是172.22.100.4
现在有一个需求,需要在dns中对dbprod126建一个别名wondadb3r的记录,也就是ping wondadb3r的时候显示的是dbprod126的ip,目前有两种方法,主要使用方法1指向别名,因为使用方法1的时候,如果dbprod126更改了ip,以后ping wondadb3r也会显示更改后的ip
方法1:指向别名,在dns中,建立wondadb3r指向服务器dbprod126,结果类似图中name为DWPROD2R的记录
方法2:指向ip,在dns中,建立wondadb3r指向ip 172.22.100.4,结果类似图中name为DWdbalias的记录
方法1的ping结果,dwprod2r和dbprod83指向通一个ip,但是ping dwprod2r时显示的是dbprod83
C:\Users\lukes.liao>ping dwprod2r
Pinging dbprod83.dai.netdai.com [172.22.100.45] with 32 bytes of data:
Reply from 172.22.100.45: bytes=32 time=136ms TTL=123
Reply from 172.22.100.45: bytes=32 time=135ms TTL=123
Reply from 172.22.100.45: bytes=32 time=135ms TTL=123
Reply from 172.22.100.45: bytes=32 time=138ms TTL=123C:\Users\lukes.liao>ping dbprod83
Pinging dbprod83.dai.netdai.com [172.22.100.45] with 32 bytes of data:
Reply from 172.22.100.45: bytes=32 time=135ms TTL=123
Reply from 172.22.100.45: bytes=32 time=134ms TTL=123
Reply from 172.22.100.45: bytes=32 time=134ms TTL=123
Reply from 172.22.100.45: bytes=32 time=135ms TTL=123
方法2的ping结果,dwdbalias和dbprod4指向通一个ip,但是ping dwdbalias时显示dwdbalias自己而不显示dbprod4
C:\Users\lukes.liao>ping dwdbalias
Pinging dwdbalias.dai.netdai.com [172.22.100.75] with 32 bytes of data:
Reply from 172.22.100.75: bytes=32 time=138ms TTL=123
Reply from 172.22.100.75: bytes=32 time=136ms TTL=123
Reply from 172.22.100.75: bytes=32 time=135ms TTL=123
Reply from 172.22.100.75: bytes=32 time=135ms TTL=123C:\Users\lukes.liao>ping dbprod4
Pinging dbprod4.dai.netdai.com [172.22.100.75] with 32 bytes of data:
Reply from 172.22.100.75: bytes=32 time=134ms TTL=123
Reply from 172.22.100.75: bytes=32 time=134ms TTL=123
Reply from 172.22.100.75: bytes=32 time=134ms TTL=123
Reply from 172.22.100.75: bytes=32 time=134ms TTL=123