Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sanjusss opened this issue Jul 5, 2020 · 8 comments
Closed

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

sanjusss opened this issue Jul 5, 2020 · 8 comments

Comments

@sanjusss
Copy link
Owner

sanjusss commented Jul 5, 2020

最近经常有同学反馈这个问题,我今天也遇到了,正好帮大家解决一下。
涉及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

可能的原因

  • alidns.aliyuncs.com服务器宕机
  • 当地电信运营商网络故障
  • docker容器无法访问网络

可能的解决方法

我们自己可以解决的只有“docker容器无法访问网络”这个问题。
执行curl https://alidns.aliyuncs.com有返回内容(403之类的),说明是docker容器无法访问网络。
如果之前手动修改过防火墙设置和docker网桥,请先修改回去。
可以通过重启网络解决一部分问题。
以CentOS7为例:

systemctl restart network
systemctl restart docker

如果你是nas,可以尝试重启nas系统后,再重启一次容器程序(不是容器)。

@sanjusss sanjusss pinned this issue Jul 5, 2020
@sanjusss sanjusss closed this as completed Jul 5, 2020
@FLIER001
Copy link

FLIER001 commented Sep 7, 2020

大神您好,我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
Copy link
Owner Author

sanjusss commented Sep 7, 2020

大神您好,我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
Copy link

FLIER001 commented Sep 7, 2020

大神您好,我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
Copy link
Owner Author

sanjusss commented Sep 7, 2020

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

@FLIER001
Copy link

FLIER001 commented Sep 7, 2020

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

@sanjusss
Copy link
Owner Author

sanjusss commented Sep 7, 2020

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

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

@FLIER001
Copy link

FLIER001 commented Sep 7, 2020

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

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

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

@hailang8635
Copy link

hailang8635 commented Mar 3, 2022

获取阿里云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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants