【Linux】Could not resolve: www.test.com (Could not contact DNS servers)

在请求微信小程序服务时候报错了

从这个报错,可以很明显的发现是域名解析不了

 

1 故障排查:因为代码里调用的是curl,所以测试一下curl是否能够正常解析dns

  

果然不行,

 

 2 解决办法: 

vi   /etc/resolv.conf

添加或者修改 DNS

nameserver 114.114.114.114
nameserver 8.8.8.8

 

重新测试curl,问题得到解决。

 

posted @ 2018-01-22 12:01  依然范儿特西  阅读(1345)  评论(0编辑  收藏  举报