Dynamic DNS getting a 404?

1. Output of caddy version:

v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=

2. How I run Caddy:

systemd


a. System environment:

Ubuntu 22.04.1 LTS
systemd

b. Command:

/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

c. Service/unit/compose file:

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

[Service]
Environment="AUTH_TOKEN=REDACTED"

d. My complete Caddy config:

#
# Dynamic DNS
#
{
	dynamic_dns {
		provider netlify {env.AUTH_TOKEN}
		domains {
			chrisshort.net casa
                }
		ip_source simple_http https://api64.ipify.org
		check_interval 5m
		versions ipv4
		ttl 5m

        }
}
#
# Uptime Monitor
#
casa.chrisshort.net {
	respond OK 200
	encode gzip zstd
	log {
		output file /var/log/caddy/uptime.chrisshort.net-access.log
	}
}
#
# Tailscale for code-server (updated via root cronjob)
#
code.hawk-egret.ts.net {
	reverse_proxy 127.0.0.1:8080
	encode gzip zstd
	tls /etc/caddy/code.hawk-egret.ts.net.crt /etc/caddy/code.hawk-egret.ts.net.key
	log {
		output file /var/log/caddy/code.hawk-egret.ts.net-access.log
	}
}
#
# Public/private DNS for code-server (this might fail given the private IP)
#
code.chrisshort.net {
	reverse_proxy 127.0.0.1:8080
        encode gzip zstd
	log {
                output file /var/log/caddy/code.chrisshort.net-access.log
        }
}

3. The problem I’m having:

I’m trying to update a DNS record at Netlify when my home’s IP address changes.

4. Error messages and/or full log output:

Aug 31 10:28:43 code caddy[857]: {"level":"info","ts":1661941723.0488567,"logger":"dynamic_dns","msg":"different IP address","new_ip":"107.5.75.251"}
Aug 31 10:28:43 code caddy[857]: {"level":"info","ts":1661941723.048907,"logger":"dynamic_dns","msg":"updating DNS record","zone":"chrisshort.net","type":"A","name":"casa","value":"107.5.75.251","ttl":300}
Aug 31 10:28:43 code caddy[857]: {"level":"error","ts":1661941723.3202653,"logger":"dynamic_dns","msg":"failed setting DNS record(s) with new IP address(es)","zone":"chrisshort.net","error":"got error status: HTTP 404: "}
Aug 31 10:28:43 code caddy[857]: {"level":"info","ts":1661941723.320307,"logger":"dynamic_dns","msg":"finished updating DNS"}

5. What I already tried:

I’ve gone back and forth on Twitter, now it’s time to deep dive into this. A 404 here is a truly odd error.

6. Links to relevant resources:

That error comes from the libdns/netlify package; the dynamic-dns plugin is working properly.

I would contact the author of that plugin, and suggest the bug might be somewhere in here where it crafts the URI?

That’s just me guessing though.

To be clear, which repo? libdns or caddy-dynamic-dns?

Libdns/netlify should have the issue filed.

This topic was automatically closed after 30 days. New replies are no longer allowed.