When using Tailscale with Magic DNS enabled, hostname resolution always routes through Tailscale—even when you’re on your home network. This adds unnecessary latency for local connections. The issue is documented in GitHub issue #1227.

A workaround is to use split DNS with a custom domain. Configure your local router with local DNS entries and set up public DNS entries that point to Tailscale IPs. When you’re at home, your devices use the router’s DNS. When away, they use public DNS.

For example, your local router DNS might have:

server.domain.com → 192.168.1.10
nas.domain.com    → 192.168.1.20

And your public DNS (via Netcup, Namecheap, etc.):

server.domain.com → 100.64.1.10  (Tailscale IP)
nas.domain.com    → 100.64.1.20  (Tailscale IP)

Your devices automatically connect directly when at home and through Tailscale when away, without manual switching. This works even with Magic DNS enabled.

You may need to flush DNS cache when switching networks:

1
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder