28

I am connecting to a Cisco VPN Server using vpnc. Once connected, my machine was unable to automatically update DNS setting from the new VPN. I tested by temporarily changing /etc/resolv.conf with the proper nameserver and search domain, and everything worked. This is obviously not a long term solution, so I added an additional DNS server and search domain to the VPN settings in Network manager. With those settings in place, resolvconf does add the search domain, but not the DNS IP, and I still cannot do any lookups.

What is my next step in configuring or troubleshooting from here?

55

First make sure that there are no lines beginning with nameserver in any files in /etc/resolvconf/resolv.conf.d. If /etc/resolvconf/resolv.conf.d/tail is a symbolic link to target original, make it point to /dev/null.

Second, disconnect from the VPN. Edit /etc/NetworkManager/NetworkManager.conf

$ sudo gedit /etc/NetworkManager/NetworkManager.conf

and comment out

dns=dnsmasq

(i.e., add a # so that it looks like the following)

#dns=dnsmasq

and then

sudo restart network-manager
  • 9
    Restart networkmanager on Ubuntu 16.04: sudo systemctl restart NetworkManager – Galgalesh May 25 '16 at 13:54
  • 5
    Another modern restart method: sudo service network-manager restart – Reinderien Jul 28 '16 at 2:33
  • 1
    Looks like this is bug from dnsmasq side? Correct? – ipeacocks Dec 20 '16 at 10:57
  • 8
    It is amazing to me that this is still a problem in 16.10 after 3 years. – Dave Kincaid Dec 29 '16 at 13:44
  • 3
    +1 -- Ubuntu 16.04 - Same issue. Same solution. Thanks – Carlo Bertuccini May 7 '17 at 7:17
6

Try checking if your /etc/resolv.conf have symbolic link to /run/resolvconf/resolv.conf . It solved the problem for me.

To check if it has symbolic link:

ls -la /etc/resolv.conf

Sample output, if it has symbolic link:

lrwxrwxrwx 1 root root 27 Jun 30 22:22 resolv.conf -> /run/resolvconf/resolv.conf

Otherwise, delete or backup existing /etc/resolv.conf and then:

sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
  • 1
    This solution worked perfectly for me, thanks! – PKKid Feb 5 '16 at 15:46
  • This is the solution that worked for me, thanks!! – Whome Nov 14 '16 at 14:13
  • After a recent apt upgrade DNS when connected to my VPN became broken. This symlink was the solution that fixed things for me, thanks! I have also used the accepted answer above when my DNS was patchy (seemed a to come and go when connected to the VPN) so I think these are both good solutions, but apply in slightly different situations. – joelittlejohn Feb 20 '17 at 9:35
  • Thank you!! Mine was oddly set to resolv.conf -> ../run/resolvconf/resolv.conf (note the ../) – James Feb 23 '17 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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