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

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

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

 

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

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

果然不行,

 

 2 解决办法: 

vi   /etc/resolv.conf

添加或者修改 DNS

nameserver 114.114.114.114
nameserver 8.8.8.8

 

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-08-02
  • 2021-06-23
  • 2021-05-19
  • 2022-12-23
猜你喜欢
  • 2021-06-16
  • 2021-08-09
  • 2021-12-04
  • 2021-11-22
相关资源
相似解决方案