-   Linux - Laptop and Netbook (
-   -   Having an internal DNS and an external DNS (for VPN use) (

DaveQB 08-01-2011 11:08 PM

Having an internal DNS and an external DNS (for VPN use)
Hard to to have a succinct title for this.
I put it in the laptop and netbook as it is a problem I would see mobile users coming across more than others.

So I have an internal DNS server (a pfsense firewall) that then uses my ISP for external name resolution. This internal DNS server answers lookups for all internal machines on my home network too, responses no other DNS server could answer with.

I have a VPN account with work. Work too has their own DNS for resolving internal domains as well external lookups.

So the issue I have is when I connect to my works VPN I have to use their DNS in order to access resources on works network, but then I lose access to my DNS server which subsequently loses me domain name access to local machines.

Right now I am using my own DNS and hand looking up work machines to then access. Seems rather silly.

I have thought I could set up a BIND server on my desktop that makes the VPN connection, but feels like overkill for such a trival problem.

I know the resolver library on most Linux machines tries the first DNS in resolv.conf and if it times outs, moves onto the next. Can it not move onto the next if the first one responses but is unable to successfully look up the given domain name? It would be the most simply solution adding only a slight delay on some lookups.

Any better solution that others have would be appreciated.


zhjim 08-30-2011 06:08 PM

Intresting stuff you got there.
Maybe you could tweak your internal dns to forward only the work domain to the vpn/work dns server.
Think of tlds.

Take alook at this
Scroll down to "10.5.2. Forward Zones". Should get you set.

That ones also quite nice:

DaveQB 08-30-2011 08:17 PM

Thank you zhjim
That is all I would need. If I could send any look up requests for a certain domain to my work DNS, I would be set.
I will follow up those links you have provided. I use pfsense as my home DNS server (dnsmasq is what it uses internally)

zhjim 09-05-2011 01:17 AM

This is an abstract taken from

# Add other name servers here, with domain specs if they are for
# non-public domains.

# Example of routing PTR queries to nameservers: this will send all
# address->name queries for 192.168.3/24 to nameserver

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.

# Add domains which you want to force to an IP address here.
# The example below send any host in to a local
# web-server.

Seems like the server config option should do the trick or maybe the address. I would aim for the server option.

All times are GMT -5. The time now is 10:28 AM.