Closed Bug 361717 Opened 18 years ago Closed 9 years ago

using windows\system32\drivers\etc\hosts file

Categories

(Core :: Networking, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mailer.tovis, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; hu; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; hu; rv:1.8.1) Gecko/20061010 Firefox/2.0

cannot connect to domain on LAN which name is marked at hosts file!
On my small home LAN (about 5 PC's) I use hosts file to give names to IP addresses, but mozzila does not realize them (explorer does)

Reproducible: Always

Steps to Reproduce:
1. Build HTTP server on LAN (apache2 on Debian 3.1 stable)
2. mark HTTP server's IP address in windows\system32\etc\hosts - you should be
   able ba name "ping foo"
3. try to connect to your HTTP server by name!

Actual Results:  
Nothing special, small LAN using hosts file for name resolv

Expected Results:  
nothing, Mozzila does not use this file?!
Firefox normally just asks the OS to resolve the domain name. Can you test if this works in Opera or another alternative, non-Mozilla browser?
Assignee: general → nobody
Product: Mozilla Application Suite → Firefox
QA Contact: general → general
Version: unspecified → 2.0 Branch
(In reply to comment #1)
> Firefox normally just asks the OS to resolve the domain name. Can you test if
> this works in Opera or another alternative, non-Mozilla browser?

I tried MS Explorer 6.0 SP2(?) - work fine!
I cannot reproduce this issue. It is working fine for me with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1pre) Gecko/20061124 BonEcho/2.0.0.1pre

The connection is working fine. But what I have recognized is that Firefox still holds the IP. Although after I removed the entry from the host file. But this should be another issue.

Reporter, is there any firewall which prevents the connection for Firefox/SeaMonkey?
Works for me - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

If you add items to your hosts file while Firefox is running you will need to /ipconfig flushdns and ctrl + shift + reload to avoid hitting Firefox's file cache.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
It is not acceptable!
This is a very simple problem, to solve you simple need to read hosts file from given path - what is does not change from win9x! But what you do - NOTHING!
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Darin, any hints from your side for this bug report?
re comment #4: the workaround did not help - Firefox still fails to display the page, giving me the following error:

503 Service Unavailable
Failed to resolve the name of server xxx to connect

When using the IP-address, it works.
Also works in InternetExplorer7 with both hostname and IP.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hi All, I have recently upgraded to firefox 3.0 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0)
The behaviour that I have noticed is similar to the problem stated here with some additional information for you to solve the issue. (In my limited understanding) The real issue seems to be that Firefox reads the DNS before the hosts file. 

Reproducible: Always
Steps to Reproduce: 
1. add entries in hosts file as below
127.0.0.1  localhost
127.0.0.1  arhant
2. Type arhant in the address bar in firefox. you get the error  - "The requested URL could not be retrieved". 
3. Try the same thing in ie7 - it directs you to your localhost page as per the host file (I have XAMPP installed, so it directs me to the XAMPP localhost default page.)

Actual Results: No page visible
Expected Results:  Hosts file to be read first and browser to resolve ip address from the host file before trying the DNS cache.

Do let me know if further info required for this. 

Regards
Arhant Jain
Additional info: if the hostname "arhant" in this case is mentioned in "no proxy for: (bypass proxy)" option, then firefox reads the ip from the host file and works fine. However adding every host file entry to the bypass proxy option is not a solution. Hence kindly have the hosts file read before the DNS cache check.

Regards
Arhant
Firefox doesn't resolve hostname when using proxy. It's a proxy server configuration problem.
Where does that lead us... ie uses the hosts file while firefox only does that if instructed to bypass the proxy (thus making it very cumbersome). 
Can anyone take this very old problem and make the changes ASAP.
 
(FYI - in my very large organisation of not less than 50k users, all the intranet sites are resolved through a hosts file of more than 3 pages. I have added the following entry for proxy bypass "10.1.1.1/10.255.255.255". This however does not take care of server names. Till this issue is resolved 99% users would NOT use this browser nor would the organisation recommend.)
Firefox ignoring my hosts file until restart the browser
1. Add line to windows\system32\drivers\etc\hosts  file
127.0.0.1       www.google.com
2. Open http://www.google.com in previously opened IE & Firefox.

Result: IE opens localhost default page, but Firefox doesn't

3. Restart Firefox.
4. Refresh page. You should see now localhost default page


But DELETED hosts from hosts file was resolved properly after short time.
Patrick, do you know what could be the reason for this behavior?
Component: General → Networking
Product: Firefox → Core
QA Contact: general → networking
Version: 2.0 Branch → 1.8 Branch
(In reply to comment #12)
> But DELETED hosts from hosts file was resolved properly after short time.

Now, in Gecko/20090615 Minefield/3.6a1pre this is untrue because Minefield always loading page loaded initially before changing windows\system32\drivers\etc\hosts.

So, if it contains "127.0.0.1       www.google.com", then removing this line does't affect browser redirection rule.
(In reply to Henrik Skupin (:whimboo) [away 07/29 - 08/11] from comment #13)
> Patrick, do you know what could be the reason for this behavior?

(behaviour being: we don't seem to read the hosts file if resolving a domain that's not listed in the "bypass proxy for" list, and instead go straight to the proxy)

Needinfo'ing now that we can do that. :-)
Flags: needinfo?(mcmanus)
Version: 1.8 Branch → Trunk
(In reply to :Gijs Kruitbosch from comment #15)
> (In reply to Henrik Skupin (:whimboo) [away 07/29 - 08/11] from comment #13)
> > Patrick, do you know what could be the reason for this behavior?
> 
> (behaviour being: we don't seem to read the hosts file if resolving a domain
> that's not listed in the "bypass proxy for" list, and instead go straight to
> the proxy)
> 
> Needinfo'ing now that we can do that. :-)

yes, the proxy normally resolves the DNS for the browser - it is part of what is proxied. That's a design choice to accommodate split horizon dns and the use of firewalls as proxies.

The gets messy when the proxy isn't "all or nothing", such as a no-proxy list, or use of a PAC file. When that happens you will pretty much see a mix of behaviors which probably isn't ideal but seems to be what is necessary.
Flags: needinfo?(mcmanus)
Status: NEW → RESOLVED
Closed: 17 years ago9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.