Ubuntu – DNS Issue in ubuntu 14.04

14.04dnsnetwork-managernetworking

I am facing DNS resolving issue sometimes in my Ubuntu 14.04.2 LTS trusty.

I have configured my system with network manager to work with static IP assignment. I have also tried by changing DNS server address but when this issue occurs I can't access any websites via URL but I can access via IP only.

During this problem, I have tried

  • to stop dnsmasq service
  • removing dnsmasq
  • restart networking service
  • restart network-manager
  • nslookup to domain like google, yahoo

Output of dump script

###### Start of debugging information for resolvconf ######
### ls -l /etc/resolvconf
total 16
-rw-r--r-- 1 root root  172 Dec 13  2012 interface-order
drwxr-xr-x 2 root root 4096 May 21 11:02 resolv.conf.d
drwxr-xr-x 2 root root 4096 May 21 10:57 update.d
drwxr-xr-x 2 root root 4096 Jul 23  2014 update-libc.d
### cat /etc/resolvconf/interface-order
# interface-order(5)
lo.inet*
lo.dnsmasq
lo.pdnsd
lo.!(pdns|pdns-recursor)
lo
tun*
tap*
hso*
em+([0-9])?(_+([0-9]))*
p+([0-9])p+([0-9])?(_+([0-9]))*
eth*
ath*
wlan*
ppp*
*
### ls -l /etc/resolvconf/resolv.conf.d
total 8
-rw-r--r-- 1 root root   1 May 19 10:08 base
-rw-r--r-- 1 root root 151 Dec 13  2012 head
### cat /etc/resolvconf/resolv.conf.d/base

### cat /etc/resolvconf/resolv.conf.d/head
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
### ls -l /etc/resolvconf/run
ls: cannot access /etc/resolvconf/run: No such file or directory
### ls -l /run/resolvconf
total 4
-rw-r--r-- 1 root root   0 Jun 10 12:41 enable-updates
drwxr-xr-x 2 root root  60 Jun 10 12:42 interface
-rw-r--r-- 1 root root 170 Jun 10 12:42 resolv.conf
### cat /run/resolvconf/enable-updates
### cat /run/resolvconf/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
### ls -l /run/resolvconf/interface
total 4
-rw-r--r-- 1 root root 19 Jun 10 12:42 NetworkManager
### cat /run/resolvconf/interface/NetworkManager
nameserver 8.8.8.8
### ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 May 21 11:09 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
### lsattr /etc/resolv.conf
lsattr: Operation not supported While reading flags on /etc/resolv.conf
### cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
### cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq

no-auto-default=E0:69:95:AB:91:5A,

[ifupdown]
managed=false
###### End of debugging information for resolvconf ######

I can't solve issue by doing all these stuffs. but only solution is to restart my computer.

Please help me as it's totally stuck my whole work due to restart the system and losing connectivity anytime.

Your help will be appreciated.

Kavin.

Best Answer

I have followed the below steps and my problem solved.

  • Remove dnsmasq:

    apt-get remove --purge dnsmasq
    
  • Comment out dns=dnsmasq by putting # in /etc/NetworkManager/NetworkManager.conf.

  • Comment out the local DNS address.

  • Comment out prepend domain-name-servers 127.0.0.1; by putting # in /etc/dhcp/dhclient.conf

  • Update resolvconf:

    resolvconf -u
    
  • Restart network-manager or reboot system:

    service network-manager restart
    
Related Question