在请求阿里云短信服务时遇到

cURL error 6: Could not resolve: dysmsapi.aliyuncs.com (Could not contact DNS servers) (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
null

不能解析域名

于是打开服务器终端

curl dysmsapi.aliyuncs.com
curl: (6) Could not resolve host: dysmsapi.aliyuncs.com; Unknown error
[root@chongpu ~]# curl baidu.com    

解决方法

vi   /etc/resolv.conf

修改dns

nameserver 114.114.114.114
nameserver 8.8.8.8

重新测试curl

[root@chongpu ~]# curl dysmsapi.aliyuncs.com
<?xml version='1.0' encoding='UTF-8'?><Error><RequestId>429BC09D-CB28-4FA2-B4F2-81E9032032F8</RequestId><HostId>dysmsapi.aliyuncs.com</HostId><Code>InvalidVersion</Code><Message>Specified parameter Version is not valid.</Message><Recommend><![CDATA[https://error-center.aliyun.com/status/search?Keyword=InvalidVersion&source=PopGw]]></Recommend></Error>[root@chongpu ~]#

成功

标签: none

添加新评论