DEV Community

Cover image for What Happens When You Visit http://localhost - A Closer Look
Ileriayo Adebiyi
Ileriayo Adebiyi

Posted on

What Happens When You Visit http://localhost - A Closer Look

Say you're developing a web application or running an http server of some sort on your local computer, you will most likely access that app (or server) by going to the url http://localhost:[SOME-PORT].

Localhost is a top level domain name (TLD) just like com as in example.com or gov as in example.gov, org, etc. It is reserved by the Internet Engineering Task force (IETF) for loopback purposes and as such, domain registrars cannot sell to you a domain name with the localhost TLD e.g., mybilliondollarblog.localhost.

What do we mean by loopback?
When your computer is connected to the internet for example, electric signals are routed through the physical network interface, the physical network card installed on your computer then through computers on the internet to the destination computer that holds whatever content you require. The loopback mechanism

The browser first (this has been in my draft for about 2 years, who knows when is finish writing it 😞)

Top comments (0)