Local DNS and OpenVPN "push" DNS

Local DNS and OpenVPN "push" DNS

Postby mackowiakp » Jun 28th, '15, 21:46

I user my laptop both in company and at home. At home I have implemented ownCloud installed on home server. On the same server is installed local DNS/DHCP (for internal needs of home LAN) based on dnsmasq.
The problem is, when I am at home and after established VPN connection to my company over OpenVPN.
The address of my home ownCloud server is blablabla.ddns.net. Of course when I am at work, World DNS system returns proper address of blablabla.ddns.net.
But when I am at home, dnsmasq returns me address of ownCloud server according to home LAN addressing.
But if I turn on VPN connection, my company server push me its own DNS server, with address 10.55.55.100. So my connection over LAN to my ownClud instance is broken, because company DNS server dont know of course about my internal home LAN addressing.
Of course using --up and --down options during establishing OpenVPN connection, it is possible to modify resolv.conf file. So I try it by simply adding address of my home DNS server. But it seams to look that if IP stack receive from the first DNS server info - no such address - it does not ask second one (that is my home internal DNS).
Is there any way to solve that problem?
Linux is like wigwam. No Windows, no Gates but Apache inside

WARNING ! The administrator has the right to refuse to install WINDOWS, invoking the conscience clause
mackowiakp
 
Posts: 660
Joined: May 23rd, '13, 07:32
Location: Gdynia, Poland

Re: Local DNS and OpenVPN "push" DNS

Postby wintpe » Jul 3rd, '15, 15:12

Hi mackowiakp

dns works on the basis of an authoritative reply is absolute.

if your dns internal is authoritative for a domain, then that wins.

so if the first server says, no such host, your name service stack returns that the host does not exist.

multiple lines in resolv.conf are not for alternative searches

(they are done with search, and thats just the ending to add to short names , when given in queries.

they are there as DR options, so if first server does not reply , maybe because its down
then try second.

the way to make a server look for alternative replies, is when you look up, for example http://www.mageia.org,

your dns server says, im not authoritative for that domain, so the forward entry takes over, and passes the request on up the dns chain, until it gets to the root servers.

you cant implement any alternatives with a client only config, you have to have a local dns server to do this.

and theres lots more you can do with a local dns server, caching, overlaying ip boundaries, and specifying different masters for different address space, etc etc etc.

multiple forwards might be the answer

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron