mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
245 stars 25 forks source link

IPv6 lookup failed with api.ipify.org #14

Closed leonghui closed 3 years ago

leonghui commented 3 years ago

Hi there,

I found the following warning while running this app with lucaslorentz/caddy-docker-proxy:

{"level":"warn","ts":1637216941.4177737,"logger":"dynamic_dns.ip_sources.simple_http","msg":"IPv6 lookup failed","endpoint":"https://api.ipify.org","error":"Get \"https://api.ipify.org\": dial tcp6: lookup api.ipify.org on 127.0.0.11:53: no such host"}

Indeed there are no AAAA records:

Non-authoritative answer:
api.ipify.org   canonical name = api.ipify.org.herokudns.com.
Name:   api.ipify.org.herokudns.com
Address: 3.220.57.224
Name:   api.ipify.org.herokudns.com
Address: 52.20.78.240
Name:   api.ipify.org.herokudns.com
Address: 3.232.242.170
Name:   api.ipify.org.herokudns.com
Address: 54.91.59.199

According to www.ipify.org, api.ipify.org will output IPv4 only. For both IPv4 and IPv6, we should use api64.ipify.org:

Oct 1, 2020 the A record for api6.ipify.org will be removed to make the subdomain only for IPv6 requests. For universal access please use api64.ipify.org.

francislavoie commented 3 years ago

Interesting.

This goes along with https://github.com/mholt/caddy-dynamicdns/issues/6

leonghui commented 3 years ago

I created a quick PR to update all references to api64.ipify.org