Linux   发布时间:2019-10-31  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了couldn't resolve host api.weixin.qq.com大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

1.代理服务器突然出现 couldn't resolve host api.weixin.qq.com 不知原因

2.重启nginx无效-----代码肯定没有动过(之前出现过,过了一天恢复)

3.防火墙关闭状态 -- service iptables status

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/e46ed1b3606f9412bbd7e7d9e7dfe2ee.png" width="424" height="72">

4. ping api.weixin.qq.com

curl api.weixin.qq.com

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/1f656a1556261fed3383acdc511173d3.png" width="366" height="83">

5.修改dns后 8.8.8.8 可以curl和ping通过

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/f9e95c9e6fbfe3e94350581cbc98c764.png" width="442" height="180">

6.还是显示couldn't resolve host api.weixin.qq.com 无法解析主机,重启network后被覆盖

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/abae808531ac3ac0d7f61089028af566.png" width="516" height="91">

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/23114a299e2a94a6724e149fa0c7cde2.png" width="411" height="140">

7.解决覆盖问题

必须要在/etc /sysconfig/network-scripts/ifcfg-eth0里面最后加上dns的设置。要不然,重启后,肯定使用eth0设置中没有设 dns的相关信息,使/etc/resolv.conf恢复到原来的状态。

(1)若有多个ifcfg-ethX,首先查看一下当前机器的IP地址,先ifconfig 查看系统走的那个配置文件,

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/1ea9c303b9ea773623e2148d10344c0f.png" width="302" height="64">

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/e2d864e1938c619abb9a156681a9c609.png" width="364" height="242">

(2)添加DNS地址

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/0d6ad07f1d1aba071a3deb3a6ddfa072.png" width="333" height="261">

8.resolv.conf设置 (一定要把代理主机写在上部,负责重启后会覆盖)

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/275c9afef6208033308552c8d7cb62e2.png" width="411" height="159">

9.设置到此已经代码curl数据不通过

10.找到hosts文件numbering">/etc/hosts,抓出微信地址写进hosts 直接生效不用重启(问题解决)

title="couldn't resolve host api.weixin.qq.com" alt="couldn't resolve host api.weixin.qq.com" src="https://cn.js-code.com/res/2019/01-12/17/0d735d58323952b3c5c2f2db433f719e.png" width="572" height="142">

大佬总结

以上是大佬教程为你收集整理的couldn't resolve host api.weixin.qq.com全部内容,希望文章能够帮你解决couldn't resolve host api.weixin.qq.com所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: