TimothyYe / godns

A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
https://timothyye.github.io/godns/
Apache License 2.0
1.5k stars 220 forks source link

错误level=error msg="failed to get online IP:403" #161

Closed tingyue-wu closed 2 years ago

tingyue-wu commented 2 years ago

执行后日志有一下错误提示 time="2022-07-03T02:17:28Z" level=error msg="get ip online failed. Fallback to get ip from interface if possible.", time="2022-07-03T02:17:28Z" level=error msg="failed to get online IP:403" 如果把改 "ip_url": "https://ip.3322.net", 那么日志显示time="2022-07-03T03:36:05Z" level=error msg="empty result"

TimothyYe commented 2 years ago

empty result表示无法查询到域名解析记录或者当前域名没有默认IP。可以给你设置的域名设定一个默认的IP试试。

tingyue-wu commented 2 years ago

empty result表示无法查询到域名解析记录或者当前域名没有默认IP。可以给你设置的域名设定一个默认的IP试试。

到哪里设置默认ip?不是很懂。he.net那里设置还是godns的配置文件里边? 目前暂时通过curl命令可以更新域名ip的。godns启动时出现错误日志以后,后面一直没有任何日志记录。 image

TimothyYe commented 2 years ago

你的配置文件能粘贴过来看看吗?删掉密码和key等敏感信息。

tingyue-wu commented 2 years ago

你的配置文件能粘贴过来看看吗?删掉密码和key等敏感信息。

{ "provider": "HE", "password": "smdI****Olmd", "login_token": "", "domains": [{ "domain_name": "lookni.cf", "sub_domains": ["look",""] },{ "domain_name": "", "sub_domains": ["",""] } ], "resolver": "8.8.8.8", "ip_url": "https://ip.3322.net", "ip_type": "IPv4", "interval": 3000, "socks5_proxy": "" }

TimothyYe commented 2 years ago
,{
"domain_name": "",
"sub_domains": ["",""]
}

这里为什么要留空的配置呢,把这里删掉试试?

TimothyYe commented 2 years ago

这里也是

"sub_domains": ["look",""]

改成

"sub_domains": ["look"]
TimothyYe commented 2 years ago

不过你提醒我了,我可以在代码里面加一些检查条件,过滤掉空的domainsub_somains

tingyue-wu commented 2 years ago

删了空的项目,果然日志正常了。谢谢!!!

TimothyYe commented 2 years ago

好的,下次我把空的项目的检查条件加上