0

I use a PPTP VPN to connect to my work's environment, but don't know how to configure DNS resolution the way it seems appropriate.

When I connect via Network Manager I get two servers in /etc/ppp/resolv.conf and mywork.com.br as a search domain in /etc/resolv.conf. While it allows me to resolve names in that network it also seems to redirect all DNS requests through the servers pushed by the PPTP server.

Differently, when I connect with pon mywork no change is done to the DNS settings, but I lose the remote name resolution that I have in the first case.

So, how can I manage to keep both DNS servers working? I mean, I'd like to resolve machine.mywork through the PPTP DNS server and everything else through my ordinary server.

Here's my /etc/ppp/peers/mywork:

pty "pptp vpn.mywork.com.br --nolaunchpppd"
name me@mywork.com.br
remotename mywork
require-mppe-128
file /etc/ppp/options.pptp
ipparam mywork 
nodefaultroute

I'm running 14.04 LTS. Thanks in advance and sorry for my bad english!

  • More information is needed though - what DNS routing changes are you expecting to see, and where? – Thomas Ward Jun 24 '15 at 1:00
1

A solution would be to run a local DNS server that can forward queries to other DNS servers based on subdomain/domain.

Ubuntu's network-manager already runs a local DNS server (dnsmasq-base) however the required options are not available so disable it then install and configure the full dnsmasq package as follows:

1) Comment out dns=dnsmasq from /etc/NetworkManager/NetworkManager.conf

2) Restart network-manager: sudo service network-manager restart

3) Install dnsmasq package: sudo apt-get install dnsmasq

4) Edit /etc/dnsmasq.conf and add:

server=/.mywork/VPN_DNS_IP
server=/#/INTERNET_DNS_IP

5) Restart dnsmaq: sudo service dnsmasq restart

  • This solution is not correct. "address" means "resolve all this TLD to this IP", instead "server" must be used to tell to ask ".mywork" TLD to "VPN_DNS_IP". So the correct usage will be : server=/.mywork/VPN_DNS_IP Second line also not necesarry while rest will be resolved using DNS of your internet connection – Can YILDIZ Jul 25 '17 at 15:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.