Remote access via cloudflared broken after HA IP change

I changed the IP of my Home Assistant while keeping the same DNS.

The remote access is now broken (bad gateway) and I can see in the logs, that the add-on resolves the Home Assistant FQDN to the old IP. (I use https, which means I must put a hostname, not an IP)

The IP change was already multiple days ago, it seems the bad cache the cloudflared add-on is using never expires…

I did change the FQDN the argo tunnel was pointing to, then set it back to the correct one, in the hope it would reset its DNS cache, but that did not work. I also rebooted HA, but it still resolves the home assistant hostname to the old IP somehow.

Where is the old IP being stored, any idea?

I noticed I have another problem, which might be related.

What I did a week ago is, I changed my physical connection actually, not just the IP. I had my HA, running on a raspberry pi 4 connected over LAN. I connected the wifi and unplugged the LAN.

Strangely, the raspberry Pi 4 got the same IPv6 over DHCP for its Wi-Fi interface: the DUID advertised is the same for the wifi interface and the LAN interface. That stumped me at the time, but I simply unplugged the LAN and decided not to troubleshoot this.

The IPv4 of the wifi interface is different though (different MAC).

And now to the additional problem I noticed: HA web interface is reachable over wlan0 IPv6 (whih is the same as the IPv6 of end0, now unplugged) but not over wlan0 IPv4.

So something has the HA think the old IP (.113) is still the correct one, even though my local DNS is updated and serves the new IP (.114).

Hope that helps.

ok, so the connection over IPv4 works again, no idea why, this is getting stranger and stranger.

I also tried uninstalling the cloudflare add-on, while selecting “Also permanently delete this addon’s data”, but upon reinstalling, it still connects to the wrong (old) IPv4.

Where is this permanent DNS cache then located, I wonder…

The local DNS A entry was wrong…

I could have sworn I edited it, but it didn’t save somehow… :roll_eyes: I also had tested it (or so I thought) but I mistakenly tested against a different DNS environment (I have two) and there it was, in fact, correct.

Maybe the universe telling my I should simplify…

At least I could verify my entire IoT is IPv6 capable because not a single one complained =)

As a side effect, I learned that DUID is expected to be the same across all interfaces of an IPv6 device, but IAID (Interface ID) must be different for each interface. Using SSH access to the host, I ran the command nmcli con show "Supervisor wlan0" | grep "DHCP6.OPTION" and nmcli con show "Supervisor end0" | grep "DHCP6.OPTION", I could verify that the IAID (DHCP6 OPTION 4) is not the same for each interface.

Either Home Assistant is not sending this IAID correctly to my router or the router has a bug…