Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't browse local domains without a network connection

I have a few different PHP sites running on local domains (i.e. domains set to 127.0.0.1 in /etc/hosts) so I can work on them without any network delay.

I'd like to be able to work on these sites when I have no connection at all (e.g. on the bus or in the park) but my browser (Firefox on LinuxMint) can't load the local pages when there's no network connection (it doesn't have to have Internet access, but it must have a working network connection). Note that it can load a site via local IP addresses or "localhost", but not using any other local domain name.

I'd like to create some kind of local network that makes the Network Manager show a valid connection even when there is no LAN adapter present. Or alternatively a way to make Firefox work with the local domains without needing the network would be just as good.

Reproduce this problem as follows:
- Run a local web-server such as micro_httpd and serve a test site
- Set up some other names for 127.0.0.1 in addition to localhost in your /etc/hosts file such as foo.bar
- Test that your site works from localhost and from foo.bar
- Unplug your network cable
- Test again, only localhost works, not foo.bar
- Test with wget, both work fine

like image 714
Aran Avatar asked Apr 19 '15 11:04

Aran


People also ask

Can you log into a domain without Internet?

If you have logged on to a Windows machine as a domain user at least once, you can logon to that machine again even if the machine no longer has a network connection.

Why can't I access my own web server from my local network?

Check the DNS servers that your local PCs are using. Switch them temporarily to a different set, such as OpenDNS or Google and see if that solves the problem. If it does, then you know there's a DNS issue. If your local PCs are getting DHCP from the modem, then they're probably getting DNS from the modem as well.

How do I access my local domain?

Navigate to System and Security, and then click System. Under Computer name, domain, and workgroup settings, click Change settings. Under the Computer Name tab, click Change. Under Member of, click Domain, type the name of the domain that you wish this computer to join, and then click OK.

Why can't my computer connect to a domain?

Restart the computer that you are trying to join to the domain to make sure that there are no latent connections to any of the domain servers. When you type the domain name, make sure that you type the DNS name and not the NetBIOS name. The error may be transient. Try again later.


1 Answers

I have the same issue. Either of these work for me, in Firefox go to about:config and click I'll be careful, I promise!, search for network.dns then either:

  • Set network.dns.disableIPv6 to false

or

  • Add your local domain names to network.dns.localDomains

I think the latter is probably the better of the two options, but either works for me.

like image 163
Lee Kowalkowski Avatar answered Nov 15 '22 08:11

Lee Kowalkowski