Solving problems regarding accessing localhost over LAN Solving problems regarding accessing localhost over LAN apache apache

Solving problems regarding accessing localhost over LAN


The IP address 127.0.0.1 is a special loopback address commonly known as localhost. It aways refers to the machine you are currently on. It's best practice not to use the 127.0.0.0/8 netblock for addressing anything other than the local machine.

The LAN you describe to also has 192.186.1.1 and 192.186.1.2 bound to each machine respectively. Use this to communicate with each machine.e.g. from 192.186.1.1, enter http://192.186.1.2:8080/ to see the other machine.

When using names, like "localhost", your Hosts file is used to resolve the name to an IP address, falling back onto DNS. On most systems, this behaviour can also be modified.

The above assumes you have no firewalls or special routing in place.


localhost is used to access the same computer from itself only. localhost always resolves to the local ip 127.0.0.1

To access one computer from another you have to use the ip address such as 192.16.8.1.1 or 192.168.1.2


localhost is an alias for the local address 127.0.0.1; it always means "this local host right here", so that's expected behavior.

You can access them either by their IP addresses, add each other's hostname to their hosts file, or set up a small DNS server.