Networking Forums

Networking Forums > Computer Networking > Linux Networking > how to configure dns fallback for vpn: try different nameserver onNXDOMAIN reply

Reply
Thread Tools Display Modes

how to configure dns fallback for vpn: try different nameserver onNXDOMAIN reply

 
 
mi
Guest
Posts: n/a

 
      07-16-2011, 10:20 AM
When I connect through VPN to a remote lan, I can resolve remote hosts
through DNS, but I cannot resolve local hosts anymore.

When the VPN connection is established, my /etc/resolv.conf is updated
so that my first nameserver is the one on the remote lan. That is
fine, and allows me to resolve host.remote.lan, and also public
Internet hosts.

However, I now cannot resolve host.local.lan, because ns.remote.lan
knows nothing about the local.lan zone. The answer it gives (NXDOMAIN)
makes my resolver give up.

What can I do so that my resolver tries ns.local.lan after receiving a
"NXDOMAIN" reply from ns.remote.lan.

 
Reply With Quote
 
 
 
 
Tauno Voipio
Guest
Posts: n/a

 
      07-16-2011, 02:08 PM
On 16.7.11 1:20 , mi wrote:
> When I connect through VPN to a remote lan, I can resolve remote hosts
> through DNS, but I cannot resolve local hosts anymore.
>
> When the VPN connection is established, my /etc/resolv.conf is updated
> so that my first nameserver is the one on the remote lan. That is
> fine, and allows me to resolve host.remote.lan, and also public
> Internet hosts.
>
> However, I now cannot resolve host.local.lan, because ns.remote.lan
> knows nothing about the local.lan zone. The answer it gives (NXDOMAIN)
> makes my resolver give up.
>
> What can I do so that my resolver tries ns.local.lan after receiving a
> "NXDOMAIN" reply from ns.remote.lan.
>


VPN is a very generic term: there are plenty of different
ways to achieve a Virtual Private Network, and at least
as many different programs to achieve it.

Which VPN are you using?

--

Tauno Voipio

 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a

 
      07-16-2011, 09:51 PM
On Sat, 2011-07-16, Tauno Voipio wrote:
> On 16.7.11 1:20 , mi wrote:
>> When I connect through VPN to a remote lan, I can resolve remote hosts
>> through DNS, but I cannot resolve local hosts anymore.
>>
>> When the VPN connection is established, my /etc/resolv.conf is updated
>> so that my first nameserver is the one on the remote lan. That is
>> fine, and allows me to resolve host.remote.lan, and also public
>> Internet hosts.
>>
>> However, I now cannot resolve host.local.lan, because ns.remote.lan
>> knows nothing about the local.lan zone. The answer it gives (NXDOMAIN)
>> makes my resolver give up.
>>
>> What can I do so that my resolver tries ns.local.lan after receiving a
>> "NXDOMAIN" reply from ns.remote.lan.
>>

>
> VPN is a very generic term: there are plenty of different
> ways to achieve a Virtual Private Network, and at least
> as many different programs to achieve it.


That's true, but surely his/her problem is pretty clearly stated as it
is, and independent of the VPN technology?

"mi" is on two different networks, there's a separate DNS for each of
them, and they are not aware of each other (and rightly so). I'm not
sure if there's a good solution for that (but I have never really
thought about it before).

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
jack
Guest
Posts: n/a

 
      07-17-2011, 08:10 PM
On Sat, 16 Jul 2011 21:51:38 +0000, Jorgen Grahn wrote:

> On Sat, 2011-07-16, Tauno Voipio wrote:
>> On 16.7.11 1:20 , mi wrote:
>>> When I connect through VPN to a remote lan, I can resolve remote hosts
>>> through DNS, but I cannot resolve local hosts anymore.
>>>
>>> When the VPN connection is established, my /etc/resolv.conf is updated
>>> so that my first nameserver is the one on the remote lan. That is
>>> fine, and allows me to resolve host.remote.lan, and also public
>>> Internet hosts.
>>>
>>> However, I now cannot resolve host.local.lan, because ns.remote.lan
>>> knows nothing about the local.lan zone. The answer it gives (NXDOMAIN)
>>> makes my resolver give up.
>>>
>>> What can I do so that my resolver tries ns.local.lan after receiving a
>>> "NXDOMAIN" reply from ns.remote.lan.
>>>

>>
>> VPN is a very generic term: there are plenty of different
>> ways to achieve a Virtual Private Network, and at least
>> as many different programs to achieve it.

>
> That's true, but surely his/her problem is pretty clearly stated as it
> is, and independent of the VPN technology?
>
> "mi" is on two different networks, there's a separate DNS for each of
> them, and they are not aware of each other (and rightly so). I'm not
> sure if there's a good solution for that (but I have never really
> thought about it before).


One way we have found to get around this is by running a local
nameserver, and adding a forwarding zone just for the network on the
other side of the tunnel. Let's say our local domain is example.com, and
we have a VPN link into somewhere that has a nameserver on 10.123.10.10,
which knows about machineXYZ.cust.local and friends.

The /etc/resolv.conf points to our local nameserver, which handles
generic internet (with a options { forwarders some-public-servers; },
and is authoritative for the example.com zone. Then add a zone like

zone "cust.local" IN {
type forward;
forwarders { 10.123.10.10; };
};

to this. Now requests for 'machineXYZ.cust.local' will be handled by
10.134.10.10. Add a 'search example.com, cust.local' to /etc/resolv.conf,
and most things will work as expected.

A few things to be aware of: you need to prevent whatever sets up
the VPN tunnel from messing with /etc/resolv.conf. Also, if the VPN
tunnel is down, the local nameserver will still try to contact
10.123.10.10, and name resolution for local zones is slow. All this can be
fixed with a bunch of scripts on tunnel up/down, how exactly depends on
what VPN client is used, if the nameserver on the other side is always
on the same address, and if the local nameserver runs on the same machine
as the VPN client. If there are duplicate host names (both example.com and
cust.local have a machinePQR), just asking for 'machinePQR' will resolve
to the local one. To get the one on the other side of the VPN tunnel we
need to use the full 'machinePQR.cust.local').


j


 
Reply With Quote
 
mi
Guest
Posts: n/a

 
      07-28-2011, 04:57 PM
On Jul 17, 10:10*pm, jack <jcfmast...@yahoo.com> wrote:
> On Sat, 16 Jul 2011 21:51:38 +0000, Jorgen Grahn wrote:
> > On Sat, 2011-07-16, Tauno Voipio wrote:
> >> On 16.7.11 1:20 , mi wrote:
> >>> When I connect through VPN to a remote lan, I can resolve remote hosts
> >>> through DNS, but I cannot resolve local hosts anymore.

>
> >>> When the VPN connection is established, my /etc/resolv.conf is updated
> >>> so that my first nameserver is the one on the remote lan. That is
> >>> fine, and allows me to resolve host.remote.lan, and also public
> >>> Internet hosts.

>
> >>> However, I now cannot resolve host.local.lan, because ns.remote.lan
> >>> knows nothing about the local.lan zone. The answer it gives (NXDOMAIN)
> >>> makes my resolver give up.

>
> >>> What can I do so that my resolver tries ns.local.lan after receiving a
> >>> "NXDOMAIN" reply from ns.remote.lan.

>
> >> VPN is a very generic term: there are plenty of different
> >> ways to achieve a Virtual Private Network, and at least
> >> as many different programs to achieve it.

>
> > That's true, but surely his/her problem is pretty clearly stated as it
> > is, and independent of the VPN technology?

>
> > "mi" is on two different networks, there's a separate DNS for each of
> > them, and they are not aware of each other (and rightly so). *I'm not
> > sure if there's a good solution for that (but I have never really
> > thought about it before).

>
> One way we have found to get around this is by running a local
> nameserver, and adding a forwarding zone just for the network on the
> other side of the tunnel. Let's say our local domain is example.com, and
> we have a VPN link into somewhere that has a nameserver on 10.123.10.10,
> which knows about machineXYZ.cust.local and friends.
>
> The /etc/resolv.conf points to our local nameserver, which handles
> generic internet (with a options { forwarders some-public-servers; },
> and is authoritative for the example.com zone. Then add a zone like
>
> zone "cust.local" IN {
> * * * * type forward;
> * * * * forwarders { 10.123.10.10; };
>
> };
>
> to this. Now requests for 'machineXYZ.cust.local' will be handled by
> 10.134.10.10. Add a 'search example.com, cust.local' to /etc/resolv.conf,
> and most things will work as expected.
>
> A few things to be aware of: you need to prevent whatever sets up
> the VPN tunnel from messing with /etc/resolv.conf. Also, if the VPN
> tunnel is down, the local nameserver will still try to contact
> 10.123.10.10, and name resolution for local zones is slow. All this can be
> fixed with a bunch of scripts on tunnel up/down, how exactly depends on
> what VPN client is used, if the nameserver on the other side is always
> on the same address, and if the local nameserver runs on the same machine
> as the VPN client. If there are duplicate host names (both example.com and
> cust.local have a machinePQR), just asking for 'machinePQR' will resolve
> to the local one. To get the one on the other side of the VPN tunnel we
> need to use the full 'machinePQR.cust.local').
>
> j


Thank you very much for the suggestion with DNS forwarding and
detailed explanations. Sounds indeed like the solution I was looking
for.

In the meantime, I had found an alternative solution by installing
dsnmasq (http://en.wikipedia.org/wiki/Dnsmasq). It can be configured
to use different name servers for different domains, with lines like

server=/localdomain.lan/192.168.44.1
server=/remotedomain.lan/192.168.81.2

Even though it is mainly designed for home networks, it worked for my
purpose. As far as I understand, it is doing about the same thing than
what you suggest, by taking over DNS on the local machine and doing
the forwarding itself.

Thanks for the help.

mi
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any reason to provide 11.b as a fallback? TBerk Wireless Internet 10 07-02-2008 11:28 PM
DHCP fallback to fixed IP Gernot Butschek Linux Networking 6 11-03-2005 12:03 PM
automatic fallback JM Wireless Internet 0 01-29-2005 02:46 AM
fallback-reboot Dan Stromberg Linux Networking 0 01-18-2005 09:30 PM
ADSL Router with ISDN fallback? Matthew Haigh Broadband 4 07-18-2003 08:15 PM



1 2 3 4 5 6 7 8 9 10 11