As the COVID-19 pandemic sweeps across the world, we wanted to take a look at the famed localhost, and share some best practices for working from home.
As the COVID-19 pandemic sweeps across the world, lots of people are just discovering the concept of remote work. We thought we’d take a quick look at the famed localhost of 127.0.0.1 and ::1, and share some best practices from the Men&Mice team on how to make the best out of working from home.
Or 127.0.0.1 (::1 for the IPv6-minded), as it were.
The standard of IPv4 reserves all 16 million addresses (give or take) of the 127.0.0.0/8 range for loopback. In IPv6, it’s only a single one: ::1. (Read more about IPv6 reserved addresses here.) In IPv4, 127.0.0.1 is the default that most computers use: in the hosts file (/etc/hosts in Linux and Mac systems; C:\Windows\System32\drivers\etc\hosts on Windows), which acts as a local DNS resolver is usually empty except for these two lines:
127.0.0.1 localhost ::1 localhost
It is defined locally, as the loopback addresses shouldn’t be sent to public name servers to avoid confusion.
Because of its special status, even machines without an actual network interface (wired or wireless connections, or even the hardware capability for connections) can still use localhost through the networking stack of the operating system. Air gapped computers can run network services (such as web servers like Apache or nginx) locally.
In most cases: either work.
There’s one notable case where the two are different: when using a MySQL server, it does matter whether using 127.0.0.1 or localhost in your preferences.
Men&Mice is fortunate in being able to encourage employees to work from home. The health and safety of our people are our highest priorities at all times.
Working remotely, however, is a tricky situation. Even under the best of circumstances it creates a disruption, and can take a heavy toll on mental health and productivity. Our team members aren’t strangers to remote work, but even for them, this is new. When the benefit of an optional change of scenery becomes the new status quo that is recommended or even mandated, being smart is essential.
We’ve asked the Men&Mice team to share their tips and best practices — hope this helps all of you struggling to adjust to the new situation.