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.49k stars 218 forks source link

能否做一下myip.la的API适配 #236

Closed gzelvis closed 4 months ago

gzelvis commented 4 months ago

自从godns换成3.0后,你页面里建议的很多查询ip API都失效了。目前能用的就只剩下这个 "https://api.ipify.org" ,但我在 Myip.la这里,标称不限查询量的 https://api.myip.la , 用curl查询输出就是纯IP应该适配godns的,但不知道为啥加到config里系统就提示格式不匹配无法使用 "Failed to update IP record: Incorrect record value"

系统是debian12,用的是最新的3.1.4 amd64版,麻烦看看怎么回事,只有一个查询IP接口总觉的不太靠谱。再次感谢为我们制作了这么好的软件

TimothyYe commented 4 months ago

https://myip.biturl.top 这个应该也可以的吧

TimothyYe commented 4 months ago
image

https://api.myip.la/ 这个我也试了,是可以的。

TimothyYe commented 4 months ago

对了,我发现如果你的机器支持IPv6, https://api.myip.la/ 默认会返回IPv6的地址,而不是IPv4

gzelvis commented 4 months ago

我curl的结果是出来v4的地址哦,而且我debian也是设置了v4优先的。有没有什么办法?看似myip.la这个api挺稳定好用的,感谢

TimothyYe commented 4 months ago

你可以在配置文件里面,打开debug log选项:

"debug_info": true,

然后可以看到GoDNS取到的IP到底是什么

gzelvis commented 4 months ago

好的。应该就是你说的这个原因了,上面你说另外一个api我试了不行应该也是v6的问题。在godns这块有没办法强制api输出v4 ip?因为我curl的时候出来的是v4结果的

TimothyYe commented 4 months ago

可以的,我需要改一下程序,重新发个版本

TimothyYe commented 4 months ago

等会儿你去下载最新发布的版本就可以了

gzelvis commented 4 months ago

辛苦大大!