LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Web browsing fails to load correct URL, ignores /etc/hosts!! Daily issue (https://www.linuxquestions.org/questions/linux-desktop-74/web-browsing-fails-to-load-correct-url-ignores-etc-hosts-daily-issue-660603/)

lefty.crupps 08-05-2008 07:59 AM

[Resolved] Web browsing fails to load correct URL, ignores /etc/hosts!! Daily issue
 
I'm at a loss. Please help. It is at the point that my internet experience is unusable.


Every day when I try to load a common set of URLs, I get Feedburner pages instead, or another site. This happens with Firefox (actually Iceweasel) and Konqueror both, on Debian Lenny with KDE (and on previous Kubuntu 7.10 and 7.04 installations).

Screenshot here of three misloads: http://picpaste.com/dns_issues.png

For example, if I visit... // I might get...
www.nytimes.com // bbc.co.uk
www.nytimes.com // "Feedburner: HTTP Status 400 - You must provide a feed uri"
www.tuxmachines.org // "Feedburner: HTTP Status 400 - You must provide a feed uri"
slashdot.org // del.icio.us
del.cio.us // bbc.co.uk

Note these are examples that change slightly every day, but overall there are pretty much always issues with NYTimes.com, Slashdot.org, and TuxMachines.org, and I often get that Feedburner page.

I was using OpenDNS but I changed that to my ISP's default nameservers; no fix. I removed OpenDNS from my DSL modem and from my network switch also. I've added the ips of tuxmachines.org in my /etc/hosts file and that is *completely ignored* by both of my web browsers -- it was this way in my old Kubuntu days also. I do not have Bind installed. I've tried rebooting. My nameserver listed in /etc/resolv.conf is from 192.168.1.1, my DCHP-enabled router.

From the command line with 'host' or 'whois' , names/ips are resolved just fine. Using 'Links' (cli browser) also results in the wrong websites being displayed however -- tuxmachines.org brings up again the Feedburner failure page.

Any ideas, anyone?

tronayne 08-05-2008 11:50 AM

No browser I know of looks in /etc/hosts for anything, so that's most likely not your problem -- it's most likely a DNS problem.

You should have one or more numeric addresses of name servers; your /etc/resolv.conf file ought to look something like
Code:

search com
nameserver nnn.nnn.n.nn
nameserver nnn.nnn.n.nn

This is, the nameserver entries should be numeric, not alphanumeric.

Routers, even if they provide DNS, tend not to update or search and you can have this sort of problem; i.e., you can count on a server, you can't really count on a router.

Your ISP should provide one or more nameserver addresses or, if not, there are a large number of public servers available (Google is a good place to look for a couple).

Hope this helps some.

lefty.crupps 08-05-2008 12:52 PM

My /etc/resolv.conf has:
nameserver 192.168.1.1
which is the router, which was pointing to OpenDNS but is now pointing to the internet DSL modem; the DSL modem was also pointing to OpenDNS but it is now getting the nameservers from my ISP.

So basically it should be hopping from one to the next until it gets to the ISP nameservers, correct?

The Windows machine on our network is getting its nameservers from the same method and has no issues, and never has (of this nature).

If I manually assign the nameservers in /etc/resolv.conf will they be wiped out at next reboot, due to DHCP addressing?

lefty.crupps 08-05-2008 12:54 PM

and why wouldn't a webbrowser look at the hosts file??

that seems somewhat madness first off, since it is the easiest method for statically assigning names and IPs; second, it does function this way with my work iceweasel when testing webserver setups that don't have DNS set up yet...

rajwinder 08-05-2008 01:38 PM

well web browser definitely looks for /etc/hosts file for name resolution if no proxy is not used ..

tronayne 08-05-2008 02:10 PM

Look for your inet1.conf file in /etc (mine is in /etc/rc.d, but yours may be located somewhere else). There is a line it that contains the string DHCP_KEEPRESOVLV; you can set that to "yes" so DHCP won't overwrite it. Then you can set your nameserver in /etc/resolv.conf to a real address and see what happens. For example, try the address your ISP gave you. You can do this without rebooting or anything, just find a real DNS address or two and stick 'em in resolv.conf as above.

This is a heck of a lot easier than trying to walk up to a router and modem and hope they work (which, obviously, they ain't or you wouldn't be asking, eh?). Your ISP gives you a DNS address or two? Use 'em!

Edit: here's a few public DNS servers http://www.tech-faq.com/public-dns-servers.shtml

lefty.crupps 08-11-2008 02:01 PM

I have resolved this issue (although not how I was hoping for) by adding the nameservers that I want to use at the end of my /etc/dhcp3/dhclient.conf file:

Code:

prepend domain-name-servers 208.67.222.222,208.67.220.220;
I would have preferred that the computer was getting its nameservers from my router but this above fix did make everything work well for over a week now, and also survives reboots.

This was a Debian Lenny install, by the way, for future readers.

Thank you all for your help!


All times are GMT -5. The time now is 12:37 AM.