Solving DNS issues with local DNS server and external hostnames

I had a weird problem when trying to connect to a navidrome server running locally. I configured the server to run on http and set up caddy as a reverse https proxy to forward requests to a subdomain managed by myself. I then configured my local DNS server to answer requests for that subdomain with an A-Record pointing to the navidrome server.

When entering the subdomain as a host in symfonium, a “could not resolve hostname” error poped up. Looking at the network settings of the android device running symfonium, I noticed two DNS servers were configured, although I thought I had set up my DHCP Server to only serve the IPv4-Address of the local DNS server. Strangely though, the android client showed another IPv6-Address that I didn’t know. Turns out it belonged to my router, which is advertising itself as an IPv6-DNS server unless explicitly configured not to do so.

So if you have a similar setup and use an openwrt-router as a DHCP server alongside a local DNS Server, make sure to disable the “Local IPv6 DNS server” setting. If you’re not doing it via the GUI, the configuration setting for the interface under /etc/config/dhcp is

config dhcp 'lan'
    ...
	option dns_service '0'
    ...