Closed Bug 698302 Opened 13 years ago Closed 9 years ago

Can't browse alias of localhost when network disconnected

Categories

(Core :: Networking, defect)

10 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: robertc, Assigned: bagder)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0a1) Gecko/20111030 Firefox/10.0a1
Build ID: 20111030031101

Steps to reproduce:

In order to work on a cross domain messaging app while I was traveling I set up two aliases for 127.0.0.1 in my /etc/hosts file: domain1.com and domain2.com.  I then started my development web server and attempted to browse to http://domain1.com:8000/file.html.


Actual results:

Firefox reports "Server not found".


Expected results:

Since the server is on the laptop, Firefox should find it.  In exactly the same situation Chrome and Opera worked fine.
It happens that i have apache running under openSUSE 12.1 and i did not noticed this problem for the http server using port 80 to display the local pages i have after disconnecting the PC from the Internet. 

Using 127.0.0.1 as address displayed anything? Have you tried using 127.0.0.1 for one alias and 127.0.0.2 for the other alias? I`m not a network guru so if my second suggestion seems a bit off please do tell :)
Browserd ID: Mozilla/5.0 (X11; Linux i686; rv:13.0a1) Gecko/20120215 Firefox/13.0a1
I can confirm this bug is happening, tested in Firefox v30 in Linux Mint 17 64-bit.

Contents of my /etc/hosts is as follows:

127.0.1.1       amidea.dev      amidea sanad.sanad.amidea.dev

Firefox is NOT in Offline Mode, however with the network disconnected I'm unable to access a local site using Firefox v30. Firefox requires network connection to even browse local sites resolving to 127.0.1.1/127.0.0.1.

Chrome (v35) can access the site normally as depicted in the screenshot.

Occurs in Linux Mint 17 64-bit.

This happens irrespective of Work Offline checked or not. Bug 339814 and bug 939318 seems to only cater to when Work Offline is checked.
I also confirm this happening, tested in Firefox v33 in Linux Mint 17.1, and earlier versions of Firefox and Linux Mint.

I have tried resetting my profile, and using a blank profile with all extensions disabled, to no avail.

I can access the local site using IP address i.e. 127.0.0.1, and also with 'localhost', but not with any other alias defined in /etc/hosts.

The same does not happen with other browsers e.g. Chrome.

Note that to reproduce the bug you may need to press Ctrl-F5 to hard refresh the page after disconnecting from the internet.

The impact is that I'm forced to use Chrome for web development when not connected to the internet :-(

Can we move this bug to 'CONFIRMED'?
When asked to be in "offline mode", Firefox makes an attempt in not actually using the network. In this mode, it is explicitly disabling name resolving _except_ for the whitelisted hostname localhost (that's preffable).

There's thus no special treatment for other localhost aliases in /etc/hosts or other mechanisms. By design.

I guess a possible minor improvement of this handling would be to scan the /etc/hosts file to find localhost aliases that should get the same treatment.
Both most recent comments in this thread (Hendy and Luke) run Linux. Bug 1008091 will make Firefox handle network changes better on Linux and that comes in version 38. Especially since we are *not* talking about enabled "work offline" mode here - which I mistakenly did in my comment 5 above.

It'd be great if any or both of you could try a beta/nightly version of Firefox to see if you can still repeat this problem with those. We've done quite a lot of work in this area the last months so chances are it works better now.
Assignee: nobody → daniel
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Component: General → Networking
Product: Firefox → Core
(In reply to Daniel Stenberg [:bagder] from comment #6)

> It'd be great if any or both of you could try a beta/nightly version of
> Firefox to see if you can still repeat this problem with those. We've done
> quite a lot of work in this area the last months so chances are it works
> better now.

With the most recent Nightly - 39.0a1 (2015-03-15) - this bug is fixed for me.

Thanks!
Thanks for confirming, case closed!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: