0

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

I can't solve issue by doing all these stuffs. but only solution is to restart my computer or I have to change my IP address and assign it back.

Output of some configuration

###### 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 ######

When I run nslookup 8.8.8.8 I get ;; connection timed out; no servers could be reached

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

  • Did you already tried to set up your DNS as 8.8.8.8? – VaTo May 27 '15 at 6:12
  • What do you get back when you ping google.com? – VaTo May 27 '15 at 6:17
  • DNS resolution issue alright. – PNDA May 27 '15 at 6:29
  • when you set up a static ip sometimes you have to 1. reconnect to the network to apply changes or 2. run the command sudo resolvconf -u. Also, do you allow port 53 for dns? – mchid May 27 '15 at 6:30
  • @SaulOrtega yes dear. I have tried with 8.8.8.8 also. I am not getting any response for any ping to url like google.com, yahoo.com, etc. but if I tried to ping their server address as ping 216.58.220.14, It's working also I can open site from browser with IP. – Kavin Chauhan May 27 '15 at 6:32
1

edit /etc/resolv.conf ; add, nameserver ip.ad.dr.es lines. You are supposed to add a nameserver or two for failover. Usually you'd use nameservers that your ISP provides, but using 4.4.2.2 and similar is ok if you want to give them your browsing habits

  • I have checked with all possible DNS but the issue remain same. There is no problem in accessing DNS server as I can ping it but my nslookup request don't response. – Kavin Chauhan May 27 '15 at 7:14
  • 1
    then maybe something is blocking traffic on port 53 – VaTo May 27 '15 at 7:18
  • Please let me know which side port 53 should be check? at my localhost or at dns server? Also please help me to detect and troubleshoot if it's happening. – Kavin Chauhan May 27 '15 at 8:18
  • @KavinChauhan usually, you can run sudo ufw status verbose to check your end, the reason for this is because dns traffic is usually sent over port 53 the same way that http is sent over port 80 and https is sent over port 443 – mchid May 27 '15 at 8:23
0

open a terminal and execute the following commands:

sudo ufw allow out 53
sudo ufw disable; sudo ufw enable   
echo "nameserver 8.8.4.4" | sudo tee /etc/resolvconf/resolv.conf.d/base
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolvconf/resolv.conf.d/base
sudo resolvconf -u

EDIT:

Another way you can set the nameserver is through dhclient:

echo "prepend domain-name-servers 8.8.4.4, 8.8.8.8;" | sudo tee -a /etc/dhcp/dhclient.conf

and restart network-manager:

sudo service network-manager restart

Also:

You can also set the name server through /etc/network/interfaces by adding the following lines to that file:

for wlan0

iface wlan0 inet
managed true
dns-nameservers 8.8.4.4 8.8.8.8

for eth0

iface eth0 inet
managed true
dns-nameservers 8.8.4.4 8.8.8.8

Finally:

one thing you might want to do is to clean out your previous connections:

sudo mv /etc/Network-Manager/system-connections /etc/NetworkManager/system-backup
sudo service network-manager restart
  • Thanks for help dear. I will try your answer once this issue occur again. I hope your answer can solve this. Also request you to be in touch during this. Your effort is appreciable and always will be. – Kavin Chauhan May 27 '15 at 9:40
  • dear.. sorry.. but this also won't work.. I have to either change my IP address and again assign previous one or have to restart system. There is no other way except this. Please help me. – Kavin Chauhan May 27 '15 at 10:08
  • dear, as my ufw status is inactive. So will you please let me know, "Is there a need to enable it and allow port 53?" – Kavin Chauhan May 28 '15 at 5:14
  • @KavinChauhan no, however, i noticed you mentioned uninstalling dnsmasq or something. I had a similar dns issue once and solved it by reinstalling dnsmasq sudo apt-get install dnsmasq and sudo service network-manager restart – mchid Jun 1 '15 at 18:03
0

Install local DNS server, enabling root zone lookup. The issue you're expecting can occur if the ISP is doing something wrong or in case of netlink faults. Just remember to enable root zone of type "hint"! and add 127.0.0.1 as your first nameserver in resolv.conf . It's not the fastest solution, but if your connectivity by-ip-address is unbreakable - it will save your day.

  • Thanks for reply. When dnsmasq is installed, it was only pointing to 127.0.0.1. after that only I tried with this local dns server 192.168.1.1. – Kavin Chauhan May 28 '15 at 4:10

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.