[TriLUG] dnsmasq and VPN

Alan Porter porter at trilug.org
Tue Jul 31 10:49:06 EDT 2012


When I am away from home, I use openvpn to connect to my home router. I 
can set up dnsmasq on my local machine to send DNS queries to my home 
router for all home addresses using this line:

server=/home.example.com/172.31.1.1

Meaning "send all requests for *.home.example.com" to 172.31.1.1 for 
resolution.

It works great... except I would like it to EXCLUDE "home.example.com" 
itself from that rule. That's the router itself, and I want to resolve 
its address using its normal resolvers, and not by tunneling through the 
VPN to ask for its internal address.

If my router's address were fixed, I could add a line like 
"address=/home.example.com/98.97.96.95" to the config file and that 
would work. But my IP is not static... it's dynamic. I have tried 
"ptr-record=home.example.com,example.dyndns.org" to tell dnsmasq to go 
look up the dyndns record for my home. But that does not seem to work.

I can't seem to have my cake and eat it, too. Does someone know the 
magic dnsmasq-fu to make it resolve that one address using its other 
resolvers, but everything WITHIN that domain using my home router?

-- 
# ɹǝʇɹoԀ uɐl∀






More information about the TriLUG mailing list