How to manage my DNS, tailscale, DHCP hostnames

I have a homelab which hosts multiple services
I use reverse proxy to access all these services, I access them with a domain I own, i.e. NameOfService.mydomain.com

One such service I run is AdguardDNS (a DNS server)
I have added this DNS server as the only DNS server that the clients on my OpenWRT router uses:
Interfaces > Lan > DHCP Server > Advanced Settings > DHCP Options > "6, IP Of MY DNS Server"
All of my devices including my server run tailscale, this is what my tailscale DNS config looks like:


The DNS records for *.mydomain.com point to the tailscale IP address of my server
I have "rewritten" my DNS records on my local DNS server to point my domain to the local IP address of my server
Therefore, I can access my services via the same domain, even if I am connected to tailscale or if I am on my routers network without tailscale

My Questions:

  • How can I get my tailnet devices to use the SAME dns server of my local DNS whilst also being able to access *.mydomain.com on both my tailnet and my router?

  • (Optional) The OpenWRT DHCP server collects devices hostsnames and adds them to the default internal OpenWRT DNS server, how can I also have these hostnames on my DNS configuration (since im using my own DNS Server), i.e. so I can ping my devices again, ping iphoneSE?

Solutions I have tried:

  • Using tailscale splitDNS for my domain (so *.mydomain.com uses a public DNS server) and the rest of my tailscale DNS queries using my ADGuardDNS server hosted on my homelab (which is on my tailnet)
    • Result: The latency when ONLY querying *.mydomain.com was quite high, reached > 2000ms when quering those domains consecutively multiple times, I am open to suggestions on fixes for this

Found a fix (Its working as of now)
Remove this setting Interfaces > Lan > DHCP Server > Advanced Settings > DHCP Options > "6, IP of MY DNS server" so the only DNS server clients use is OpenWRTs, openWRT uses my Adguard DNS as upstream I removed the DNS rewrites on the adguard side and instead added them on the OpenWRT DNS side Then I pointed my Tailscale DNS directly to my Adguard DNS's IP

Damn I am an idiot, I could've just used my brain for 5 seconds instead of outsourcing it to the hivemind

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.