Amiga.org

The "Not Quite Amiga but still computer related category" => Alternative Operating Systems => Topic started by: Glaucus on April 26, 2004, 12:48:22 AM

Title: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 12:48:22 AM
This is really bizzare!  I setup an apache web server on my WinXP machine. I can access it fine if I enter my IP address in IE6's address bar. If, however, I access it using "mike-xp", it fails, giving me a 502 - Bad Gateway error. In my hosts file I entered the following line:
192.168.1.100 mike-xp

That's my machine's IP address. When I load NetInfo (http://netinfo.tsarfin.com/copyright.html) and Lookup mike-xp, it gives me 192.168.1.100. However, if I go into NetInfo's HTML tab I get the same BAD GATEWAY error I get from IE6 - which tells me it's not just IE6 that's being screwy, something seems wrong at the TCP/IP level.

This used to work before, but I'm not sure what I may have changed to cause this... Could the IP addresses be cached? I'm not using a proxy, so that shouldn't be it (even if it were, that wouldn't explain this behaviour).

Also, in my hosts file I have a ton of ad servers to be blocked out. The ads are not blocked at all when I'm using IE6, yet if I lookup the ad servers on NetInfo I get 127.0.0.1. :-? What the heck is going on?!? Is there an option to by-pass the HOSTS file when using IE6? I must have accidently set that (or some other software has). I ran AdAware, SpyBot Search & Destroy and PestPatrol, but all they found were a few cookies. My virus software hasn't reported anything either. I'll have to run Hijack this again and really analyze the output, but was wondering if anyone had any idea what might be causing this...

Otherwise, my internet is working fine!

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: Argo on April 26, 2004, 12:58:56 AM
In your network settings did you define a default gateway?
Did you change any of your network setting or physical network layout? Do you have other computer on a network? If so can they access that computer by name?

In your httpd.conf, what do you have for servername?
Title: Re: HOSTS file ignored by IE6!!!
Post by: KennyR on April 26, 2004, 01:17:21 AM
It's not up to IE, it's just a browser. It's up to the TCP/IP stack.

Try http://mike-xp

that should do it. Without the http:// prefix, IE thinks that "mike-xp" is a path on your hard drive, since it's wired to work on your local path too (dumb Microsoft browser and desktop manager integration, bah). But numbers will usually be used as IPs.
Title: Re: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 02:24:21 AM
Quote

Argo wrote:
In your network settings did you define a default gateway?

Ummm...  I don't think so. When I look at my Network Connection Details I see this:
IP Address: 192.168.1.100
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
DHCP Server: 192.168.1.1
DNS Servers: 64.59.176.13 & 64.59.176.15
WINS Server is blank

192.168.1.1 is my router's IP address, which is connected to my cable modem. In my Internet Protocol (TCP/IP) Properties settings I have it set to automatically obtain the IP address and the DNS servers from DHCP (which would be my router in this case). So that all seems fine, right?

Quote
Did you change any of your network setting or physical network layout?
Nope, I don't think so.

Quote
Do you have other computer on a network? If so can they access that computer by name?
Yes, I do actually, and both computers can access each other by name without problem. And just for fun, I tried to access the apache server on mike-xp from my other XP machine (which has a similar hosts file) using http://mike-xp, and it worked! However, http://mike-xp still gives me the Bad Gateway when I do it on my (mike-xp) machine.

So it really does seem like my hosts file is being ignored!

Quote
In your httpd.conf, what do you have for servername?
ServerName mike-xp:80

But I don't think apache has anything to do with it, and in fact, the real reason I'm even looking into this is because I noticed that ads on websites are no longer being blocked by my hosts file. For example, the line 127.0.0.1 ad.doubleclick.net is entered in my hosts file, yet all ads from that server show up consistantly. At first I thought it was a cache problem, but I flushed them several times now.

The only thing I can think of is that I used one of those "registry cleaner" tools, and it's possibly it accidently removed something from my registry that it shouldn't have. Of course, I have no idea if that's really the cause or not...  :-(

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: Argo on April 26, 2004, 02:53:59 AM
Nork! Didn't think of that. Stupid IE. I hate that "feature. Which means you can load up a webpage while browsing your HD or even in Word!
Title: Re: HOSTS file ignored by IE6!!!
Post by: adolescent on April 26, 2004, 04:28:07 AM
The hosts file definately works with IE.  Perhaps there is a formatting problem in the hosts file that is causing a problem.  Try starting with an empty file I guess.
Title: Re: HOSTS file ignored by IE6!!!
Post by: Jope on April 26, 2004, 05:28:55 AM
Do you use a proxy? The hosts file will help you only if you make your browser go directly.

Netinfo (what's wrong with typing nslookup in a cmd window, btw) will probably use IE's proxy settings.
Title: Re: HOSTS file ignored by IE6!!!
Post by: DethKnight on April 26, 2004, 06:18:47 AM
Your setup is similar to mine. Cable-Modem feeding router then feeding two machines. And oddly enough I have been working on my Apache server in VectorLinux not WinXP. My first time ever at any sort of webserver administration or html
 The only difference I have is, I have static IPs on my two local machines, and make my router do DHCP with the cablemodem

Quote
DHCP Server: 192.168.1.1
 is empty or ignored here

It would annoy me look up my localmahcine IP on a recurring basis. Not to mention trying to do loopback testing with a moving IP. (Granted the DHCP lease can be for several hours)

I had problems with enabling files for download. I could get them served up on a list when the browser pointed to the "server" machine, but no D/L would happen.

Title: Re: HOSTS file ignored by IE6!!!
Post by: Tekoneiric on April 26, 2004, 06:23:39 AM
Try clearing your DNS cache with:

ipconfig /flushdns

Also, XP and 2000 sometimes act a little freaky when the Primary DNS Suffix is empty. That setting is in System Properties/Change/More. I ran into that from time to time when doing broadband support.

Andrea
Title: Re: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 07:49:24 AM
Hey,

I tried a couple of things. 1) I trimmed down my hosts file, just incase there was some strange format error causing it to choke up. Not difference. 2) ipconig /flushdns. No difference.

I tried entering some other bogus URLs, just to see what would happen and to my surprise, I get the same Bad Gateway error. Is that what's supposed to happen when you enter a bad URL? I tried http://www.amigaaa.org (http://www.amigaaa.org) and it gave me the same error that I got with mike-xp (http://mike-xp). Something is screwy...

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: Casper on April 26, 2004, 08:36:32 AM
Try dropping the "-" from your hostname and see if helps. We've had problems with hostnames with "-" and "_" in them here at work.
Title: Re: HOSTS file ignored by IE6!!!
Post by: Jope on April 26, 2004, 10:07:04 AM
Quote

Glaucus wrote:
I tried entering some other bogus URLs, just to see what would happen and to my surprise, I get the same Bad Gateway error.

Please reread my reply about proxies and check to see whether you have some defined in your browser's config.
Title: Re: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 07:38:48 PM
Quote

Jope wrote:
Please reread my reply about proxies and check to see whether you have some defined in your browser's config.
Okay, I tripple checked it, and when I go into Internet Options->Connections->LAN Settings, the Use Proxy Server is unchecked. Unless there's another location where I can check for a proxy, I am not using a proxy and never was.

Now, as for nslookup. I ran it, but I'm not really sure how that thing works. Here's what I get when I run it:

$ nslookup
Default Server:  ns3nr.wp.shawcable.net
Address:  64.59.176.13

>

What does that tell me??? I know that 64.59.176.13 is one of the DN servers at shaw, the other is 64.59.176.15.

Btw, I also cross posted this on www.TweakXP.com (http://forum.tweakxp.com/Forum/forum_posts_view.asp?TID=13762&TPN=1), and I've examined a few registry settings as well (DnsPriority & HostsPriority), but they seem to checkout fine.

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: seer on April 26, 2004, 07:47:15 PM
It's probably unrelated, but does your PC have more then 1 NIC ? Are there any more gateways defined in those NICs ?

Also, what happens if you go to http://127.0.0.1 or http//localhost ?

As a last test, hook up another computer on the lan and try to acces the website either bij DNS name or IP adress..

May not give anything to help, but it's worth to check it just in case..
Title: Re: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 07:54:06 PM
Quote

seer wrote:
It's probably unrelated, but does your PC have more then 1 NIC ? Are there any more gateways defined in those NICs ?
Nope, just the one NIC.

Quote
Also, what happens if you go to http://127.0.0.1 or http//localhost ?

127.0.0.1 gives me this:
Server Error
The following error occurred:
[code=CANT_CONNECT_LOOPBACK] Cannot connect due to potential loopback problems

localhost gives me:
The page cannot be displayed

The strange thing is, if enter localhost twice in a row, the 2nd time it seems to go off searching for it indefinetly, and times out.

Quote
As a last test, hook up another computer on the lan and try to acces the website either bij DNS name or IP adress..
Already did that. The 2nd PC has no problem accessing my machine, either using the IP address or a domain name specified in it's hosts file.

Quote
May not give anything to help, but it's worth to check it just in case..
Well, thanks for trying.  :-)

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: seer on April 26, 2004, 08:03:36 PM
127.0.0.1 gives me this:
Server Error
The following error occurred:
[code=CANT_CONNECT_LOOPBACK] Cannot connect due to potential loopback problems

localhost gives me:
The page cannot be displayed[/b]

Try this;

tracert 127.0.0.1 in a CMD console, if you get more then 1 hop, you've got a problem, 1 I never seen before ;-)

Does your host file have a localhost entry ? Should be there as a standard (127.0.0.1 localhost)

And because another machine can acces the webpage by DNS, you pretty much excluded the webserver/apache as the problem..
Title: Re: HOSTS file ignored by IE6!!!
Post by: Jope on April 26, 2004, 08:16:24 PM
Quote

Glaucus wrote:
Unless there's another location where I can check for a proxy, I am not using a proxy and never was.

No automatic configuration script either?

The messages you were getting seriously looked like proxy messages..
Title: Re: HOSTS file ignored by IE6!!!
Post by: seer on April 26, 2004, 08:23:21 PM
The messages you were getting seriously looked like proxy messages..

But then, local addresses are not through a proxy or DNS server.. Ofcourse, IE must be told to do that by the proxy settings..
Title: Re: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 08:37:46 PM
Okay, did the trace route:
$ tracert 127.0.0.1

Tracing route to localhost [127.0.0.1]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  localhost [127.0.0.1]

Trace complete.

Mike@mike-xp ~
$ tracert localhost

Tracing route to mike-xp [127.0.0.1]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  localhost [127.0.0.1]

Trace complete.

Mike@mike-xp ~
$ tracert mike

Tracing route to mike [192.168.1.100]
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms  mike [192.168.1.100]

Trace complete.


Incase you're wondering, I'm using Cygwin/Bash.

As for my hosts file, I trimmed it down to two entries:
127.0.0.1  localhost
192.168.1.100 mike

I then did an ipconfig /flushdns * ipconfig /displaydns:
$ ipconfig /displaydns

Windows IP Configuration

         mike
         ----------------------------------------
         Record Name . . . . . : mike
         Record Type . . . . . : 1
         Time To Live  . . . . : 602457
         Data Length . . . . . : 4
         Section . . . . . . . : Answer
         A (Host) Record . . . : 192.168.1.100


         1.0.0.127.in-addr.arpa
         ----------------------------------------
         Record Name . . . . . : 1.0.0.127.in-addr.arpa.
         Record Type . . . . . : 12
         Time To Live  . . . . : 602457
         Data Length . . . . . : 4
         Section . . . . . . . : Answer
         PTR Record  . . . . . : localhost


         100.1.168.192.in-addr.arpa
         ----------------------------------------
         Record Name . . . . . : 100.1.168.192.in-addr.arpa.
         Record Type . . . . . : 12
         Time To Live  . . . . : 602457
         Data Length . . . . . : 4
         Section . . . . . . . : Answer
         PTR Record  . . . . . : mike


         localhost
         ----------------------------------------
         Record Name . . . . . : localhost
         Record Type . . . . . : 1
         Time To Live  . . . . : 602457
         Data Length . . . . . : 4
         Section . . . . . . . : Answer
         A (Host) Record . . . : 127.0.0.1

Just get's stranger and stranger doesn't it?

And yes, no proxy, no startup script. It's is however set to Automatically detect settings.

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: Glaucus on April 26, 2004, 08:56:34 PM
Ummm....  I think I fixed it....  Boy do I feel silly now. I unchecked the Automatically detect settings button and all seems to be working fine now!!! So, umm...  I guess IE was detecting the settings all wrong, but I swear I've always had that checked. Strange. Oh well, it seems to be working now. On the plus side, I've learned a great deal about Windows networking! Thanks for all the help guys! :-D

  - Mike
Title: Re: HOSTS file ignored by IE6!!!
Post by: seer on April 26, 2004, 09:07:19 PM
127.0.0.1 localhost
192.168.1.100 mike


Not sure if that is correct, you may want to try

127.0.0.1 localhost
127.0.0.1 mike

I'm running a webserver on my work PC at home, and only use the default host file.. But I don't know if Apache requires it or not (I just use IIS..)

I don't think it's a DNS error as your PC shouldn't need to access a DNS to find it's own DNS name.. Offcourse, you can always try to disable the NIC, do another DNS flush and try to it again with the NIC still disabled..