I have a domain I use for applications I self-host. Let's call it example.dev. I use Cloudflare Tunnels to proxy http requests to those applications. This works great when I'm out.
When I'm home there isn't really a reason to go through Cloudflare. So I set up AdGuardHome and have a DNS override so anything hitting *.example.dev is forwarded to my homelab server.
My router/dhcp hands out 192.168.1.2
as the Primary (Adguard) and 192.168.1.1
as the Secondary (My gateway itself)
This is working perfect on all but one computer. My Ubuntu laptop (22.04.3 LTS) wants to resolve example.dev to my WAN IP.
Running resolvectrl status
shows that I am getting the right setup, but look at the output. It wants to default to my secondary sever. Why? Is there a way I can force it?
Oh, and I can ping 192.168.1.2
from this laptop. If I reboot, it will use that DNS server for a few minutes but it switches back to .1. Can I stop that from happening?
man resolv.conf
you will seeIf there are multiple servers, the resolver library queries them in the order listed.
You can have the "primary" and "secondary" type setup as long as the first one you have listed responds fast enough. I actually have this configured and for the most part it will hit the one I have listed first, but sometimes it gets overwhelmed and goes to the one I have listed second. So my second one has the same stuff my first one does. – Terrance Dec 18 '23 at 03:27