39

I am presently running Ubuntu 12.04 and using Chrome/Firefox along with OpenDNS (have tried Google Public DNS as well as DNS of my ISP).

Suddenly, a lot of websites that I visit frequently don't load anymore. Some of them are imgur, yahoo, fed-sudoku, microsoft and addons page of firefox. I am sure there are many more that won't load.

I have Windows 7 in Dual-Boot and there are no problems whatsoever in opening these pages on Windows.

Brief History

Two weeks ago I installed Ubuntu 12.10. I faced this issue right away. I thought something must have gone wrong with the installation, so I removed Ubuntu 12.10 and instead installed Lubuntu 12.10, but the issue persisted. So, I tried opening these webpages in Live Environments (of Ubuntu 12.10, Lubuntu 12.10 and Ubuntu 12.04.1) from USB. The issue was there for Ubuntu 12.10 and Lubuntu 12.10. However, I was able to access these webpages from Ubuntu 12.04.1. So, I installed 12.04.1 on my HardDisk. Everything on 12.04 was fine till yesterday; but suddenly, these sites don't load anymore. Windows 7 in Dual-Boot works flawlessly.

Updates

(1) In response to Zhang's Answer to check basic terminal commands - I have used both OpenDNS and GooglePublic DNS to test these commands (Restarted my PC in between). These are the terminal outputs while using OpenDNS and while using GooglePublicDNS.

(2) This is the result of ifconfig - Pastebin Link.

(3) Thereafter I tried to use wget to check if the problem was with the Browser. However, it didn't work for webpages which are not loading in my browser. This is the Pastebin Link showing it for Google(works) and Yahoo(doesn't work).

(4) Then followed the instructions listed at noobslab to disable IPV6. Also, restarted my PC. However, it didn't help either.

(5) Then, I edited my Wired Connection through Network-Manager to ignore IPV6. After that, I tried to open Yahoo in Browser - it did load the first time. However, when I tried again, it didn't load. Other problem sites didn't load at all.

(6) Again tried wget. However, this time passed the argument -4 to it; ie; wget -4 www.yahoo.com. But once again, didn't get any response.

(7) Then, tried to fiddle with MTU. Followed this link to check what is the maximum that I can set. For me, the maximum possible was 10324. Also tried other values like 1500, 1492, 1452 and 100. But this didn't help either.

(8) Re-installed Ubuntu 12.04.1, wiping out the previous installation and as such all other changes. Also installed all the available updates. For the first half-an-hour, I was able to load all the webpages - including the ones which had problem. But lateron, I have the same issue as earlier - not able to load pages like yahoo, imgur, microsoft, fed-sudoku, etc.

(9) Question by laurent

From wget pastebin info in the question, the problem is not DNS as the wget and dig commands reach Yahoo's IP. This said, I don't know why nothing downloads with wget! Have you set a firewall? (you can check with sudo iptables -L). In ifconfig results, there are 2 interfaces, ppp0 and eth0. Which one should be used to connect to internet? Could you post the result of route command? Obs: eth0 has no IPV4 address so I think it is not properly configured (how is /etc/network/interfaces?)

Here is the Pastebin Link for terminal outputs of sudo iptables -L ; route and cat /etc/network/interfaces. I am not running any firewall. It's a clean install of Ubuntu 12.04.1. ppp0 is used to connect to the internet (this takes username and password which was given by my ISP) and eth0 is the Intel's OnBoard LAN which connects the modem through ethernet port.

(10) Tried to append nameserver 208.67.222.222 line in /etc/resolv.conf (since, I am using OpenDNS). But this didn't help (even after restart). So reverted the changes back. This is also a part of answer provided by laurent - it's required if I want to use OpenDNS.

Other Info

  • I have an ADSL modem (not a router) connected to the PC with an Ethernet Port. To connect to the internet, I have a DSL Connection. So, I use PPPOE to connect.
  • Terminal Output for System Information sudo lshw -C network ; cat /etc/resolv.conf ; ifconfig -a - Pastebin Link
Zanna
  • 70,465
Aditya
  • 13,416

9 Answers9

21

Part 1 - PPPoE connection not working

I would try disabling the Network Manager and configuring the network manually like explained in Ubuntu help ADSLPPPoE. Use the Config with pppoeconf part first which is basically running sudo pppoeconf and answering the questions. As you need to use a different DNS server than the one of your ISP, answer no to the question about using the peer DNS server.

Optional if your internet connection is not restarted at boot: You can edit nano /etc/rc.local, add the following lines before the exit line and reboot to test it.

killall pppd
ifconfig eth0 up
pon dsl-provider

Network manager won't be used when you use the manual config but you can disable it clicking on it and de-selecting the option enable network (and enable wireless if present). If disabling only doesnt work, you can also uninstall it with sudo apt-get remove network-manager and after sudo apt-get autoremove to clean the auto-installed packages.

Part 2 Changing default ISP DNS server to openDNS

I found here that the best way to use a static DNS with resolvconf is to add the nameserver in /etc/network/interfaces or to add it in /etc/resolvconf/resolv.conf.d/head. As your interfaces are automatically configured (dhcp) you have to use the head file:

sudo nano /etc/resolvconf/resolv.conf.d/head

and add at the end:

nameserver 208.67.222.222
nameserver 208.67.220.220

Limitations

  • You cannot use Network-Manager to connect. However, this automatically gets you connected to the internet. Otherwise, you can connect by running pon dsl-provider. To disconnect, you need to be sudo, so running sudo poff disconnects.
  • [This issue is only with Ubuntu 12.04.] While Booting Ubuntu (with Modem turned off or while it is still trying to establish a link with the ISP) - Ubuntu waits for loading Network-Configuration for about 2 mins and thereafter boots without Network-Configuration. To get online you have to run pon dsl-provider.

Fixes to remove the previous tests made (not needed in other cases):

As we deleted the resolv.conf symlink before, we need to recreate it (not needed on new install):

cd /etc
sudo rm resolv.conf
sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf

If this works, you can revert the changes in /etc/dhcp/dhclient.conf we made before.

Aditya
  • 13,416
laurent
  • 6,779
  • Hey!! What did you do? The problem sites are loading using this method sudo pppoeconf. I just hope it isn't temporary. Hopefully, you know the problem now. Is there any way I can use Network Manager instead of running the commands pon dsl-provider and poff dsl-provider everytime. Thank You. Thank You very much :) :) :) – Aditya Dec 17 '12 at 16:02
  • 4
    This answer includes the advice to remove the resolvconf package. This package is part of the base system in Ubuntu 12.04 and later. There are very few legitimate reasons to remove resolvconf, and I don't see any of those reasons applying here. If you really want to have a static /etc/resolv.conf file then it is better to leave resolvconf installed and just replace the symbolic link /etc/resolv.conf -> ../run/resolvconf/resolv.conf with a static file. It is better because the presence of resolvconf prevents other packages from overwriting /etc.resolv.conf. – jdthood Dec 17 '12 at 20:28
  • @jdthood thanks for this explanation, so this may be why the file get rewritten. In the past, I tried to remove the symlink on fixed IP servers and was getting a lot of errors from resolvconf package. This is why I said to remove it when removing the symlink. Will update answer on this point. So if reinstall resolvconf package pon will stop rewriting resolv.conf? – laurent Dec 17 '12 at 21:20
  • 2
    Yes. Packages in the Ubuntu main repository that historically have written to /etc/resolv.conf directly have been modified so that they will refrain from writing to /etc/resolv.conf if the resolvconf package is installed. So even if you just want a static /etc/resolv.conf, it is good to have resolvconf installed because it will act as a sort of prophylactic. The resolvconf program (/sbin/resolvconf) never ever touches /etc/resolv.conf directly; it writes to /run/resolvconf/resolv.conf; and the resolvconf package makes one and only one attempt to set up the symlink at /etc/resolv.conf. – jdthood Dec 17 '12 at 21:38
  • @jdthood thanks for the explanation. I didn't knew the other packages have been rewritten. Yes, a static resolv.conf is what the OP needs as he doesn't want to use his ISP DNS. Is there a (good) way to do this configuring resolvconf? Like placing the nameserver you want in the base file under /etc/resolvconf directory or something similar? – laurent Dec 17 '12 at 21:46
  • 1
    @Aditya - OK edited according to your results. To answer your question about the rc.local modification, it is to be used only if your internet connection is not restarted on boot (as it wasn't in 12.04 but looks to start ok now in 12.10 so it can be removed). The long time to boot when your modem is not operational is because you use a diffent DNS that is not reachable while the connection is not fully established. Possibly if you remove the dhclient.conf modification and use only the resolv.conf one this will not happen. Anyways, I'm proposing a different way to do this in a new edit. – laurent Dec 18 '12 at 12:42
  • 1
    Glad it is working! You can try sudo poff -a to see if it is a permission problem. If it solves the problem see if your user has the right permissions with id and see if you are in dip and dialout groups. If not you can add with sudo adduser your-user dialout. To check what's happening, use tail /var/log/ppp.log after poff (or better tail -f /var/log/ppp in one terminal while using poff in another) to see why it is not working. – laurent Dec 18 '12 at 14:47
  • When you add a user to a group, you need to log off and log on to apply the new group so possibly from next login you won't need sudo. – laurent Dec 18 '12 at 15:41
  • I need to be sudo to use it. Have tried it :) – Aditya Dec 18 '12 at 15:51
12
  1. Verify that your client can communicate with the openDNS servers

    sudo traceroute -n -w 2 -q 2 -m 30  208.67.222.222
    

    If the last line of the output does not list 208.67.222.222 as the final hop, or if there are significant timeouts, there may be a network problem preventing you from contacting openDNS servers.

  2. Verify that openDNS can resolve the selected hostname

    dig @208.67.222.222 www.difficult.com.      
    

    At the command prompt, run the following command, replacing www.difficult.com. with the name that you were having difficulty resolving (putting a period at the end of the name to avoid problems with domain suffixes and search lists)

    If the output does not show an answer for the hostname, continue:

  3. Verify that another open resolver can resolve the selected hostname

    dig @8.8.8.8 www.difficult.com.
    dig @8.8.8.4 www.difficult.com.
    dig @4.2.2.1 www.difficult.com.
    dig @4.2.2.2 www.difficult.com.
    

    If you do get a successful result, there may be a problem with openDNS

  4. Check to see if the authoritative nameservers are correct

    intoDNS is very helpful.


UPDATE:
This answer could not deal with the problem , just for troubleshooting.
If DNS resolve worked fine,go to see laurent's answer furthermore.


Reference:public DNS troubleshooting

yuan
  • 362
  • From wget pastebin info in the question, the problem is not DNS as the wget and dig commands reach Yahoo's IP. This said, I don't know why nothing downloads with wget! Have you set a firewall? (you can check with sudo iptables -L) – laurent Dec 17 '12 at 12:45
  • True, in ifconfig results, there are 2 interfaces, ppp0 and eth0. Which one should be used to connect to internet? Could you post the result of route command? Obs: eth0 has no IPV4 address so I think it is not properly configured (how is /etc/network/interfaces?) – laurent Dec 17 '12 at 12:59
  • 2
    Hi Zhang, sorry for the confusion over on Super User. I've placed a bounty on this question so it receives more attention. Cheers! – slhck Dec 17 '12 at 13:18
  • 1
    @slhck: Thanks for providing a Bounty on this question.. AskUbuntu and Ubuntu Community is great... I'm lovin' it... Cheers!!! – Aditya Dec 17 '12 at 13:36
  • @Aditya, do you have a file in /etc/ppp/resolv? If so could you look if your ISP DNS is written there? and change it to openDNS IPs. So you can change back the -i attribute on /etc/resolv.conf – laurent Dec 17 '12 at 20:21
  • @laurent: I guess its a blank directory... for ls -l it shows total 0... :) – Aditya Dec 17 '12 at 20:44
  • @Aditya After jdthood explanations on resolvconf and other packages behavior, I modified the answer. Basically, reinstalling resolvconf should prevent the file to be rewritten. – laurent Dec 17 '12 at 21:50
4

Append this line to you /etc/resolv.conf:

nameserver 8.8.8.8
jasmines
  • 11,011
  • I am using OpenDNS as of now. Are you sure I should append Google's DNS Servers? – Aditya Dec 17 '12 at 13:49
  • I used to have a problem like yours. Just append a dns (even OpenDNS could work) to your resolv.conf as in my answer and give it a try. – jasmines Dec 17 '12 at 14:01
  • 2
    your computer will actually use them all in order, so adding one to the end might get things working, but if the first nameservers are still timing out your system will be slow. – ImaginaryRobots Dec 17 '12 at 18:08
  • Note that in Ubuntu 12.04 and later you should not normally edit /etc/resolv.conf because it is dynamically updated by resolvconf. If you really want a static /etc/resolv.conf file, leave the resolvconf package installed and replace the symbolic link at /etc/resolv.conf by a static file containing (as per the present example) nameserver 8.8.8.8. – jdthood Dec 17 '12 at 20:30
4

The original problem could possibly have been solved by doing the following.

sudo apt-get install resolvconf
sudo dpkg-reconfigure resolvconf
jdthood
  • 12,467
  • Should doing this solve the problem on Live CD as well.. If yes, I would try it on Ubuntu 12.10 Live CD.. – Aditya Dec 17 '12 at 20:46
  • It probably won't solve anything on a genuine original Ubuntu 12.04 or 12.10 Live CD because it is known that resolvconf is correctly installed on those CDs. But many Ubuntu derivatives have made CDs with flawed resolvconf installations. Such flawed installations can sometimes be repaired by running sudo dpkg-reconfigure resolvconf. – jdthood Dec 17 '12 at 20:53
  • The original problem was occuring with resolvconf still installed (and on live CDs), it was due to pppoe config not DNS. The problem with resolv.conf being rewritten with the OP ISP DNS instead of openDNS appeared when configuring ppp connection (sudo pppoeconf) so I thought resolvconf was rewritting it (but as we could see later, this was not the case!). Anyways, the problem is very strange as some sites were OK and some were not and in all cases, DNS resolution was (and is still) working. The only issue now is that the OP wants to use a different DNS server. – laurent Dec 17 '12 at 21:28
  • Doing sudo dpkg-reconfigure resolvconf and following the prompts/instructions solved my problem! That's all it took! – vincent gravitas May 08 '16 at 00:29
3

Maybe you can try disabling the dnsmasq:

sudo vim /etc/NetworkManager/NetworkManager.conf

Put a # in front of dns=dnsmasq

Then:

sudo restart network-manager

I have a problem of resolving some websites after I installed 12.04 and 12.10. After I disabled dnsmasq everything worked fine.

If this helps, you can then install the full dnsmasq service and put your favourite DNS provider in /etc/resolvconf/resolv.conf.d/tail.

Aditya
  • 13,416
  • I would like to try this. However, my Network Manager shows my LAN as Device not managed. Hence, it also doesn't show the DSL Connection that I created just now. Have a look at this image. – Aditya Dec 22 '12 at 12:12
  • NetworkManager is not managing the interface because it is manualy configured in /etc/network/interfaces as a result of running pppoeconf. The problem was that the automatic connection made by NetworkManager wasn't working but you may try it now (as you know how to repair if it stops working). Just comment out the lines added by pppoeconf in /etc/network/interfaces and change managed=false to =true in /etc/NetworkManager/NetworkManager.conf.Now that you know where is the problem, please report if it doesn't work automatically and we may try to solve it using network manager. – laurent Dec 23 '12 at 00:39
  • @laurent and @snowhawkyrf: I tried it. However, this doesn't work for me. Using pppoeconf seems to be the only option to solve the problem. Anyways, thanks for your inputs. – Aditya Dec 23 '12 at 06:39
0

Well, I just write this command whenever this stops working, I still believe it to be a bug, or maybe I am doing something wrong with my pc

service NetworkManager restart

It should start working ( if there is a internet connection offcourse). But if it doesn't work, try updating the dns records and then go for the above command again. It shold work.

0

Same issue i have faced in my laptop with Ubuntu 20.04.

  1. Clear the browser history and cookies
  2. Restart the network manager(sudo service network-manager restart)
  3. Restart your ubuntu

This steps fixed my issues

0

Same problem occurred here (ASUS EeePC 1015BX - Ubuntu 12.10 - AMD C-60 system). GEditing the /etc/resolv.conf file (sudo -H gedit /etc/resolv.conf) and replacing the nameserver 127.0.1.1 line with the following

nameserver 208.67.222.222
nameserver 208.67.220.220

solved the problems.

You can make this permanent by using these procedures.

Zanna
  • 70,465
0

Apparently, the problem is how Ubuntu deals with DSL connections. I failed to configure my DSL connection as suggested by the experts.

As a work around, I'm using TOR, since there are only handful of websites which are affected by it.

maisun
  • 39
  • 5