前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >更改默认DNS导致内网域名解析异常,继而导致内网服务异常,如何解决?

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

原创
作者头像
Windows技术交流
修改2022-03-02 14:40:15
7.6K0
修改2022-03-02 14:40:15
举报
文章被收录于专栏:Windows技术交流

更改默认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.qcloud.com

l.yd.qcloud.com

u.yd.qcloud.com

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

hosts文件路径:c:\windows\system32\drivers\etc\hosts

管理员身份打开cmd,执行notepad c:\windows\system32\drivers\etc\hosts打开hosts文件

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

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

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

echo. >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.3 mirrors.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.15 update2.agent.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.4 receiver.barad.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.5 custom.message.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.23 metadata.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.19 kms.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.54 kms1.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.26 windowsupdate.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.2 ntpupdate.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.79 time1.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.80 time2.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.81 time3.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.82 time4.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

echo 169.254.0.83 time5.tencentyun.com >> c:\windows\system32\drivers\etc\hosts

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

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云服务器
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档