Caddy Plugin Inconsistency

Started by fakebizprez, October 10, 2025, 09:43:44 PM

Previous topic - Next topic
I'm trying to set up a handler to a machine I have running the UniFi Server OS to manage my UniFi access points. Like many other times I've set up a handler on the Caddy plugin, it has given me nothing but problems. Sometimes it works fine, sometimes it doesn't. I do not understand the inconsistency with this. It should be pretty straightforward, but it's not.

References for the logs:
- 192.168.128.4 is my OPNsense IP
- 192.168.128.32 is the actual server IP but i should not have duplicate DNS records.
- My internal domain is an actual Cloudflare domain, which is why I use Unbound DNS Host Overrides.

What am I missing here? I can't lose three hours of my day every time a reverse proxy needs to be setup. Frustration is an understatement.


fakebizprez@scum-studio: /Users/fakebizprez
➜   curl -v https://unifiserver.******.cloud
* Host unifiserver.******.cloud:443 was resolved.
* IPv6: (none)
* IPv4: 192.168.128.32, 192.168.128.251, 192.168.128.4
*   Trying 192.168.128.32:443...
* connect to 192.168.128.32 port 443 from 192.168.128.10 port 54358 failed: Connection refused
*   Trying 192.168.128.251:443...
^C
fakebizprez@scum-studio: /Users/fakebizprez
➜   nslookup unifiserver.******.cloud
Server:         192.168.128.4
Address:        192.168.128.4#53

Name:   unifiserver.******.cloud
Address: 192.168.128.4
Name:   unifiserver.******.cloud
Address: 192.168.128.32

fakebizprez@scum-studio: /Users/fakebizprez
➜   doggo unifiserver.******.cloud
NAME                            TYPE    CLASS   TTL     ADDRESS         NAMESERVER
unifiserver.******.cloud.     A       IN      3600s   192.168.128.32  192.168.128.4:53
unifiserver.******.cloud.     A       IN      3600s   192.168.128.4   192.168.128.4:53
Founder & President of linehaul.ai - a logistics and technology services provider.

This is not the fault of Caddy. It does not influence your DNS records...

When DNS is configured properly the plugin works just fine.

Fix the duplicate A-Records, it shouldnt point to the service and the firewall, that creates round robin DNS. Also DNS caches, so your client needs to flush its cache when you change something (DNS related)

If you dont want to spend hours troubleshooting, improve your infrastructure to work in a predictable way.
Hardware:
DEC740

I know how to flush the client DNS. I also have dozens of different clients to test on.

The point of my post is that my DNS is not configured to point to both, and my cache is flushed, yet this is the output of the dig, doggo, & nslookup commands.
Founder & President of linehaul.ai - a logistics and technology services provider.

This was the culprit:

Register DHCP Static Mappings Register ISC DHCP4 Leases
Founder & President of linehaul.ai - a logistics and technology services provider.