Using local DNS server and an exit node

I run dnsmasq on my laptop to handle some complicated DNS settings that vary depending on where I am and what context I’m working in. This works fine with tailscale except when using an exit node. If I use an exit node, even with “Use Tailscale DNS Settings” turned OFF, tailscale overwrite the resolv.conf file and DNS lookups fail.

I have MagicDNS disabled for my account. Running tailscale set --accept-dns=false seems to have no effect when using an exit node.

For what it’s worth, I believe DNS and the exit node worked fine until I enabled “Allow Local Network Access”. Now regardless of the “Allow Local Network Access” setting, DNS is overwritten when the exit node is activated.

❯ dscacheutil -q host -a name google.com                                                                                                                                                                                                        
name: google.com                                                                                                                                                                                                                                
ipv6_address: 2a00:1450:400f:80c::200e                                                                                                                                                                                                          
                                                                                                                                                                                                                                                
name: google.com                                                                                                                                                                                                                                
ip_address: 142.250.74.142                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                
❯ tailscale set --exit-node xen-bal01                                                                                                                                                                                                           
❯ dscacheutil -q host -a name google.com                                                                                                                                                                                                        
❯ ping google.com                                                                                                                                                                                                                               
ping: cannot resolve google.com: Unknown host                                                                                                                                                                                                   

❯ tailscale set --accept-dns=false                                                                                                                                                                                                              
❯ dscacheutil -q host -a name google.com                                                                                                                                                                                                        
❯ ping google.com                                                                                                                                                                                                                               
ping: cannot resolve google.com: Unknown host                                                                                                                                                                                                   

❯ tailscale set --exit-node ""                                                                                                                                                                                                                  
❯ dscacheutil -q host -a name google.com                                                                                                                                                                                                        
name: google.com                                                                                                                                                                                                                                
ipv6_address: 2a00:1450:400f:80c::200e                                                                                                                                                                                                          
                                                                                                                                                                                                                                                
name: google.com                                                                                                                                                                                                                                
ip_address: 142.250.74.142                              

Tailscale version 1.44.0
MacOS 11.7.8