更改默认DNS导致内网域名解析异常,继而导致内网服务异常,如何解决?

2022-03-02 14:40:15 浏览数 (1)

更改默认DNS后,激活等内网域名相关的服务比如云监控、云镜、ntp、update 等通过加hosts方式实现

建议执行命令加hosts之前,先在正常没改dns的同类型机器得到最实时的IP(比如给基础网络机器加,那么在同地域同可用区没改dns的基础网络机器上去ping这些域名,以实际得到的IP为准,vpc的话,用没改dns的vpc机器去ping这些域名得到IP)

mirrors.tencentyun.com

update2.agent.tencentyun.com

receiver.barad.tencentyun.com

custom.message.tencentyun.com

metadata.tencentyun.com

kms.tencentyun.com

kms1.tencentyun.com

windowsupdate.tencentyun.com

ntpupdate.tencentyun.com

time1.tencentyun.com

time2.tencentyun.com

time3.tencentyun.com

time4.tencentyun.com

time5.tencentyun.com

s.yd.zijiebao.com

l.yd.zijiebao.com

u.yd.zijiebao.com

例如ping或nslookup得到IP,可以通过手动方式添加到hosts,也可以通过命令添加到hosts

hosts文件路径:c:windowssystem32driversetchosts

管理员身份打开cmd,执行notepad c:windowssystem32driversetchosts打开hosts文件

左边IP紧跟空格或Tab按键再紧跟域名,例如

linux也是类似的,IP空格或Tab然后域名

以管理员身份打开cmd命令行,执行如下命令可以添加hosts

echo. >> c:windowssystem32driversetchosts

echo 169.254.0.3 mirrors.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.15 update2.agent.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.4 receiver.barad.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.5 custom.message.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.23 metadata.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.19 kms.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.54 kms1.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.26 windowsupdate.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.2 ntpupdate.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.79 time1.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.80 time2.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.81 time3.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.82 time4.tencentyun.com >> c:windowssystem32driversetchosts

echo 169.254.0.83 time5.tencentyun.com >> c:windowssystem32driversetchosts

metadata.tencentyun.com 试下169.254.10.10和169.254.0.23,如果2个IP都能访问http://metadata.tencentyun.com/meta-data/uuid,随便哪个IP都行

具体metadata.tencentyun.com对应哪个IP,访问如下2个URL,哪个能访问通,就在hosts里面指定哪个IP

http://169.254.0.23/latest/meta-data/uuid

http://169.254.10.10/latest/meta-data/uuid

169.254.0.23、169.254.10.10这2个IP,vpc机器都能访问,但是基础网络机器只能访问169.254.10.10。

s.yd.zijiebao.com、l.yd.zijiebao.com、u.yd.zijiebao.com ,云镜的3个内网域名对应的IP经常变,摸不清规律,以实测的为准,建议在同子网里购买个按量机器并把dns改回vpc默认183打头的那2个DNS(183.60.83.19、183.60.82.98)然后ping云镜相关的域名(或nslookup域名)得到IP,获得ip后把刚买的按量机器销毁即可

0 人点赞