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

ip_url 接口如果通过代理后会是代理的IP #178

Closed FisherMS closed 2 years ago

FisherMS commented 2 years ago

ip_url 接口如果通过代理后会是代理的IP

这个有办法解决吗?

TimothyYe commented 2 years ago

能展开讲讲吗?

FisherMS commented 2 years ago

我今天更新到最新版本后。(Docker) https://api.ipify.org/ https://myip.biturl.top/ https://ip4.seeip.org/ https://ipecho.net/plain https://api-ipv4.ip.sb/ip 在Docker中和Web上直接访问这几个接口取得的IP地址全是我上网的代理IP。(我还没有使用全局代理,只是用白名单。)

路由器上的实际公网IP并没有取得。 当我关掉代理后,就能在Docker中取得实际的IP了。也就是路由器上的公网IP。

我找到办法了。把Docker所在机器加入免代理列表就行了。

不知道能不能在路由器上加个WebHook,把实际的公网IP通知给Docker中的GODNS,由GODNS来更新。这样的话,我觉得是最有效率的。

TimothyYe commented 2 years ago

如果你单独设置了一层全局代理,Docker是没法感知到的,除非把docker的IP白名单不走代理

FisherMS commented 2 years ago

如果你单独设置了一层全局代理,Docker是没法感知到的,除非把docker的IP白名单不走代理

嗯。目前是这么解决的。