DNS Issue in ubuntu 14.04

13,976

Solution 1

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
    

Solution 2

Try this

In /etc/NetworkManager/NetworkManager.conf comment out the line dns=dnsmasq

sudo nano /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq

and restart the NetworkManager service.

sudo restart network-manager

Then

sudo rm -f /etc/resolv.conf  # Delete the symbolic link

and

sudo nano /etc/resolv.conf

    # Content of static resolv.conf
    nameserver 8.8.4.4
    nameserver 8.8.8.8

On this way you pc will resolve names without dnsmasq with dns servers in /etc/resolv.conf

Share:
13,976

Related videos on Youtube

Kavin Chauhan
Author by

Kavin Chauhan

Updated on September 18, 2022

Comments

  • Kavin Chauhan
    Kavin Chauhan over 1 year

    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.

    • jdthood
      jdthood almost 9 years
      Please append the output of the following command: /usr/share/resolvconf/dump-debug-info.
    • jdthood
      jdthood almost 9 years
      Are you basically saying "I don't know how network configuration works in Ubuntu and I have gone around changing random things with unfortunate results. Can you please help me fix my system?" That sort of question should be asked in Ubuntu Forums.
    • Kavin Chauhan
      Kavin Chauhan almost 9 years
      @jdthood There is no such file in /usr/share/ . I am also aware about ubuntu network configuration, but I had tried all these above stuff to debug and solve this problem. In many solutions, they had suggest to do these stuffs so I just tried these all but my issue is looking different.
    • jdthood
      jdthood almost 9 years
      Ah, sorry, now I see that script /usr/share/resolvconf/dump-debug-info was not present in the version of the resolvconf package that was included in Ubuntu 14.04. You can download the script from here: anonscm.debian.org/cgit/resolvconf/resolvconf.git/tree/bin/…
    • Kavin Chauhan
      Kavin Chauhan almost 9 years
      @jdthood Thanks for reply. Will you please provide path where to store this and by which name? As here in you link path is mentioned like /root/bin/dump-debug-info
    • jdthood
      jdthood almost 9 years
      That the questioner doesn't reply seems like another good reason to close this question.
    • Kavin Chauhan
      Kavin Chauhan almost 9 years
      @jdthood dear, I always respect your effort. As you can see in my question, I wrote that I face this issue sometimes only. I have applied all's suggestion but no one has solved my problem. I will surely put your dump script output once I face the problem. Please cooperate for a while.
    • Sergiy Kolodyazhnyy
      Sergiy Kolodyazhnyy almost 9 years
      Use supersede domain-name-server option in /etc/dhcp/dhclient.conf
    • spacec0wb0y
      spacec0wb0y almost 8 years
  • jdthood
    jdthood almost 9 years
    Yes, you can disable resolvconf in this way and create a static resolv.conf file with fixed addresses. This is, however, only a workaround for a problem that is undoubtedly some sort of configuration error. It's better to stay with the standard configuration (with dynamic resolv.conf) and to find and fix the configuration error.
  • Kavin Chauhan
    Kavin Chauhan almost 9 years
    @27-7974 Thanks for the response. I have already perform this tasks as mentioned "tried changing dns server". even I also tried with commenting "prepend domain-name-servers" in /etc/dhcp/dhclient.conf during dhcp assignment. But though facing same issue in static and dhcp assignment both.
  • jdthood
    jdthood almost 9 years
    If you have a static IP address assignment, as you say you do, then changing the dhclient configuration will have no effect.
  • Kavin Chauhan
    Kavin Chauhan almost 9 years
    @jdthood I mean, I have check with all possible configuration. I also work with static assignment and did all above mentioned changes. After that I have also use my system with dhcp assignment but yet the issue is same.