What is the localhost?


What is local host? 

local host is the  name describing the local computer address also known as the loop back address.  typing: ping localhost would ping the local IP address of 127.0.0.1 that is loop back address. When doing setup of a web server or software on a web server, 127.0.0.1 is used to point the software to the local machine."
In computer networking  local-host refers to "this computer" (home computer).

A key word in this definition is "network," because the term localhost comes into play only when someone (such as a programmer) is at their computer, connected to a network and using it to test programs or to test the virtual connection between two computers.
Why is localhost useful?
Let's say you wanted to call your own cellphone to test a ringtone you created. You could dial your telephone number to see what happens. However, you'd have to dial the entire number as it goes out throughout the cellphone network, as if you're calling any outside number. It's treated like any other call.
That's a lot of effort just for a simple test, don't you think?
Wouldn't it be nice if there were some way to skip the entire number and the cellphone network thing? What if instead you could simply punch in a name like "thisphone" and it would work, as if you dialed your number and it routed normally?
That's the general idea behind localhost.
Way back when, network developers and programmers realized that it would be convenient to their program tests and checks close at hand, rather than have everything go onto the Internet, every time they wanted to test something they were working on.
So, they created a solution and term: localhost.
When IT people are on their computers' testing programs and connections and they type in the word "localhost" it's a substitute for something else: their computer's (more specifically, "this computer's") IP address.
Don't let that confuse you. It's not much different from you typing in Disney.com or Amazon.com in your browser's address bar. Every website has its own IP address, but you substitute a "domain name" instead.
So, when an IT person is running tests and he's "telling" an application to connect to the Internet, he'll type in the destination "localhost."
In other words, he can pretend to be connecting to a Web server or another host computer, but he's keeping it in-house and close to home by using localhost.
On almost all networking systems, localhost uses the IP address 127.0.0.1. That is the most commonly used IPv4 "loopback address" and it is reserved for that purpose. The IPv6 loopback address is ::1.
Here's a definition of localhost from another source. See if this makes more sense now.
"Using the loopback interface bypasses any local network interface hardware. The local loopback mechanism is useful for testing software during development, independently of any networking configurations. For example, if a computer has been configured to provide a website, directing a locally running web browser to http://localhost may display its home page."
Now go out and impress your friends.
Note: They won't be impressed.

Comments