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

Host with both IPv6 and IPv4 tries to use IPv6 to update A record #15

Open
timkgh opened this issue Nov 6, 2022 · 2 comments
Open

Host with both IPv6 and IPv4 tries to use IPv6 to update A record #15

timkgh opened this issue Nov 6, 2022 · 2 comments

Comments

@timkgh
Copy link

timkgh commented Nov 6, 2022

I have a host that has a static IPv6 address but its IPv4 address is dynamic. I'd like to update the IPv4 when it changes, but cloudflare-ddns-client obtains the IPv6 and tries to set it for the A record which of course fails:

10:37PM INF Found public IP '2600:1900:...
...
Error: failed to update DNS record '<redacted>' to IP address '2600:1900:...': HTTP status 400: Content for A record must be a valid IPv4 address. (9005)

The DNS and URL queries need to force an IPv4 connection, the equivalent of:
dig -4 myip.opendns.com A @resolver1.opendns.com

@d4z3x
Copy link

d4z3x commented Jun 9, 2023

This is be fixed in my fork. I did contribute 2 things back, but I don't see the author active. So feel free to use the fork at https://github.com/d4z3x/cloudflare-ddns-client

@rightkick
Copy link

rightkick commented Jun 20, 2024

Ideally this should be supported from flags to allow the user to define IP address family, such as --ipv4 and --ipv6.

One alternative work-around is to disable IPV6 at the host by adding the following at /etc/sysctl.conf:

net.ipv4.ip_forward = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Then apply with sysctl -p /etc/sysctl.conf

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