caddy-dynamicdns
caddy-dynamicdns copied to clipboard
Interface IP source doesn't refresh when server connects to internet on boot
When I reboot my server, docker compose/caddy starts before it connects to the internet and has an IP address, so the interface IP source doesn't return anything and so doesn't update the dynamic dns with the new IP once it does connect.
Possible solutions:
- Have a "disconnected TTL" option with a default of, say, 20 seconds, so when all sources fail to return an IP address, they will keep trying until it works
- When all sources fail, check if the system is online and wait to be online before trying again. This could be combined with the above, so the "disconnected TTL" option would only be used once it's online again until a source returns an IP, at which point it will use the normal TTL value
- Could apply those globally, or only to certain sources like the interface source
The solution is probably that you delay the Docker service to start after the networking services. If you're using systemd, you'd want to adjust the Docker service with After=network.service, I think.
Hmm, it looks like my docker service already has After=network-online.target. I'm just using the default one in debian bookworm for docker compose.