1

I upgraded to Ubuntu 12.10 using update manager. After the upgrade, the wifi gets connected but would not display any webpages. If I ping 8.8.8.8 or google.com, there is response.

I managed to fix this problem by using the command sudo dhclient wlan0. But, now the problem is that every time I switch wireless networks, I have to give that command. how do I make this permanent?

Ubuntuser
  • 9,816

2 Answers2

1

You need to edit your DNS configuration.
Type gksudo gedit /etc/resolv.conf in the terminal. Add your DNS ( eg 8.8.8.8 ) in place of 127.0.0.1.
As pointed out, this configuration may be overwritten. Use resolvconf to modify this file.

ignite
  • 8,936
  • I changed it to gedit for the sake of future inexperienced users. – nanofarad Oct 18 '12 at 23:24
  • 1
    resolv.conf gets overwritten sometimes. Use resolvconf instead. See http://askubuntu.com/questions/130452/how-do-i-add-a-dns-server-via-resolv-conf – user68186 Oct 18 '12 at 23:29
  • @ObsessiveSSOℲ resolv.conf is not present starting Ubuntu 12.04 – Ubuntuser Oct 18 '12 at 23:45
  • @Ubuntuser Why are you addressing this post toward me? I did nor write it. Please address it to the author, Ignite. – nanofarad Oct 18 '12 at 23:53
  • @Ubuntuser It is present. To know more about it just type man resolv.conf – ignite Oct 19 '12 at 00:06
  • @Ubuntuser see my answer here and it will not be overwritten. – NickTux Oct 19 '12 at 00:24
  • @ĭgnĭtE: As user68186 said, resolv.conf gets overwritten sometimes. I will try to use solution provided by NikTh and see if it works. Thanks – Ubuntuser Oct 19 '12 at 08:46
  • This answer is wrong. In Ubuntu since 12.04, resolv.conf is dynamically generated by the resolvconf utility and, as the comment in the file says in FULL CAPS, you should not edit the file by hand. – jdthood Oct 29 '12 at 07:33
1

Most likely the symbolic link /etc/resolv.conf -> ../run/resolvconf/resolv.conf is missing on your system. To restore it, do the following in a terminal.

sudo apt-get install resolvconf
sudo dpkg-reconfigure resolvconf

If you want to use 8.8.8.8 as your nameserver then set up either ifup or NetworkManager to use that nameserver address for the interface(s) that it brings up.

If you use ifup then edit /etc/network/interfaces and, in the stanza for the interface in question, add the line "dns-nameservers 8.8.8.8"; then ifdown the interface and ifup it again.

If you use NetworkManager then open the connection editor and add 8.8.8.8 as an additional nameserver address (network indicator | Edit Connections... | Wireless | myconnection | Edit... | IPv4 Settings | Additional DNS servers).

jdthood
  • 12,467