sanjusss / aliyun-ddns

阿里云动态域名工具,支持docker和ipv6。
BSD 3-Clause "New" or "Revised" License
500 stars 94 forks source link

“无法获取DNS记录”问题的解决方案 #32

Closed sanjusss closed 4 years ago

sanjusss commented 4 years ago

最近经常有同学反馈这个问题,我今天也遇到了,正好帮大家解决一下。 涉及issues:

17

20

28

后续会在程序启动时增加联网检测,方便大家排查问题。(#29 )

日志提示

获取xxx.yyy.zzz的所有记录时出现异常:Aliyun.Acs.Core.Exceptions.ClientException: SDK.WebException : HttpWebRequest WebException occured, the request url is alidns.aliyuncs.com System.Net.WebException: Resource temporarily unavailable Resource temporarily unavailable

可能的原因

FLIER001 commented 4 years ago

大神您好,我docker进入ddns容器后 curl https://alidns.aliyuncs.com 有返回内容,但仍然出现了issue #28 一模一样的错误(设置也一样)。与此同时,我使用路由器padavan固件中的Aliddns更新阿里云域名却没有问题,不知问题出在了哪儿。

贴上curl的结果: <?xml version='1.0' encoding='UTF-8'?><Error><RequestId>7D581B86-5697-48E1-B205-191F4547D469</RequestId><HostId>alidns.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>

sanjusss commented 4 years ago

大神您好,我docker进入ddns容器后 curl https://alidns.aliyuncs.com 有返回内容,但仍然出现了issue #28 一模一样的错误(设置也一样)。与此同时,我使用路由器padavan固件中的Aliddns更新阿里云域名却没有问题,不知问题出在了哪儿。

贴上curl的结果: <?xml version='1.0' encoding='UTF-8'?><Error><RequestId>7D581B86-5697-48E1-B205-191F4547D469</RequestId><HostId>alidns.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>

错误内容是这个吗?

Aliyun.Acs.Core.Exceptions.ClientException: SDK.WebException : HttpWebRequest WebException occured, the request url is alidns.aliyuncs.com System.Net.WebException: The operation has timed out. at System.Net.HttpWebRequest.GetResponse()

FLIER001 commented 4 years ago

大神您好,我docker进入ddns容器后 curl https://alidns.aliyuncs.com 有返回内容,但仍然出现了issue #28 一模一样的错误(设置也一样)。与此同时,我使用路由器padavan固件中的Aliddns更新阿里云域名却没有问题,不知问题出在了哪儿。 贴上curl的结果: <?xml version='1.0' encoding='UTF-8'?><Error><RequestId>7D581B86-5697-48E1-B205-191F4547D469</RequestId><HostId>alidns.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>

错误内容是这个吗?

Aliyun.Acs.Core.Exceptions.ClientException: SDK.WebException : HttpWebRequest WebException occured, the request url is alidns.aliyuncs.com System.Net.WebException: The operation has timed out. at System.Net.HttpWebRequest.GetResponse()

是的,日志如下:

Aliyun.Acs.Core.Exceptions.ClientException: SDK.WebException : HttpWebRequest WebException occured, the request url is alidns.aliyuncs.com System.Net.WebException: The operation has timed out., at System.Net.HttpWebRequest.GetResponse(), at Aliyun.Acs.Core.DefaultAcsClient.DoAction[T](AcsRequest1 request, Boolean autoRetry, Int32 maxRetryNumber, String regionId, AlibabaCloudCredentials credentials, Signer signer, Nullable1 format, List1 endpoints), at Aliyun.Acs.Core.Http.HttpResponse.GetResponse(HttpRequest request, Nullable1 timeout), at Aliyun.Acs.Core.DefaultAcsClient.DoAction[T](AcsRequest`1 request, Boolean autoRetry, Int32 maxRetryNumber, IClientProfile profile), at aliyun_ddns.DomainUpdater.GetRecords(String domain)

sanjusss commented 4 years ago

@FLIER001 你用的是什么版本的镜像? 有试过重启NAS吗?

FLIER001 commented 4 years ago

试过重启,最近几天出现的问题,尝试pull了最新的docker镜像,也还是这样。实在没想明白到底是哪出了问题

sanjusss commented 4 years ago

试过重启,最近几天出现的问题,尝试pull了最新的docker镜像,也还是这样。实在没想明白到底是哪出了问题

System.Net.WebException: The operation has timed out.这个异常只和容器没有联网有关系。但你已经测过容器内可以访问网络,确实很奇怪。你是怎么进入容器的?

FLIER001 commented 4 years ago

试过重启,最近几天出现的问题,尝试pull了最新的docker镜像,也还是这样。实在没想明白到底是哪出了问题

System.Net.WebException: The operation has timed out.这个异常只和容器没有联网有关系。但你已经测过容器内可以访问网络,确实很奇怪。你是怎么进入容器的?

问题解决了,应该是本地运营商的DNS问题,换成谷歌的DNS就好了~

hailang8635 commented 2 years ago

获取阿里云DNS记录时异常: ClientException: SDK.WebException : HttpWebRequest WebException occured, the request url is alidns.aliyuncs.com System.Net.WebException: The operation has timed out.

不知道是不是因为阿里云更新了接口导致的接口错误,最新公网IP变动后基本更新不成功了!新写了个Golang版本的阿里云DDNS更新程序,支持Docker部署,群晖可用

https://github.com/hailang8635/go_test/blob/master/ddns/aliyun_ddns_app.go