0

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?

enter image description here

Joe
  • 101
  • Simply put, the OS can use any DNS server that is available. So if you don't want a particular server to be used, then don't offer it to the client. This answer will provide more info: Stop resolvectl Changing DNS – mpboden Dec 18 '23 at 02:28
  • I thought the whole purpose was to have a primary and then a secondary as a backup when the primary is offline. Huh....Today I Learned – Joe Dec 18 '23 at 02:43
  • 1
    If you read man resolv.conf you will see If 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

0 Answers0