问题:
爬虫代码昨天在CentOS6.5上还能跑,今天再跑却遇到DNS错误:
twisted.internet.error.DNSLookupError: DNS lookup failed: no results for hostname lookup: www.mytestorg.org.cn.
排查:
ping www.mytestorg.org.cn 不通
解决:
编辑/etc/resolv.conf
增加8.8.8.8和8.8.4.4以及114.114.114.114
保存
解决
参考:
https://blog.youkuaiyun.com/zd8582zd/article/details/49070049

本文介绍了一种在CentOS6.5中遇到DNS错误的问题及其解决办法。通过修改/etc/resolv.conf文件并添加新的DNS服务器地址(如8.8.8.8、8.8.4.4和114.114.114.114),成功解决了爬虫程序运行时出现的DNS解析失败问题。
2085

被折叠的 条评论
为什么被折叠?



