DNS Issue in ubuntu 14.04

2

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.

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.

Kavin Chauhan

Posted 2015-05-27T05:29:39.443

Reputation: 143

Can you post a copy of your /etc/network/interfaces file, pls? – MariusMatutiae – 2015-05-27T13:56:03.737

@MariusMatutiae Thanks for reply. I have configured my IP using network-manager through gui so this file have only loopback with two lines written. 1. auto lo 2. iface lo inet loopback. Please also note that I can generally use my computer without any changes but at any time it stop to respond DNS. – Kavin Chauhan – 2015-05-28T03:57:32.840

We need to see contents of /etc/resolv.conf when it is working and then also when it is not working. – milli – 2015-06-01T22:55:53.723

Answers

1

I have followed the below steps and my problem solved.

  • Remove dnsmasq

    apt-get remove --purge dnsmasq

    comment “dns=dnsmasq” by putting #symbol in etc/NetworkManager/NetworkManager.conf

  • Comment local dns address

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

  • update resolvconf

    resolvconf -u

  • restart network-manager OR reboot system

    service network-manager restart

Kavin Chauhan

Posted 2015-05-27T05:29:39.443

Reputation: 143

I can ping 8.8.8.8 but not ping google.com. I have switched ISP from ADSL to Cable. Wireless on Laptop Win7 works, I can ssh to ubuntu from win, but ubuntu machine cannot go to internet. Those steps did not solve my issue. – Vladimir Vukanac – 2016-02-15T16:36:24.977

Hi mrW, Please give your output of cat /etc/resolv.conf – Kavin Chauhan – 2016-02-16T04:28:54.537

I resolved it somehow. I needed to have static IP, and switched to DHCP it did not work, but with DHCP address only with DNS 8.8.8.8 it worked, I guess. It is Lubuntu 15.04/15.10. – Vladimir Vukanac – 2016-02-16T09:46:58.223

You have not given DNS server address in your in your router or DHCP server you are using. Just write your DNS server or use google DNS by adding, nameserver 8.8.8.8 in /etc/resolv.conf. – Kavin Chauhan – 2016-02-16T12:36:51.570