Hide Your IP Address
Home  »  Learn  »  Home Computing  »  Localhost

What is a localhost?

 Share the knowledge!

There is so much specialized terminology related to computers that it's impossible for the average person to know what they mean and refer to. Fortunately, it's also unnecessary to know all this terminology before you jump on the Internet and do whatever it is you want to do.

That brings us to the computer term of the day—localhost.

If you're not a network administrator and/or you don't run a help desk, do you need to know what localhost means? The answer is no.

If you want to impress the IT guys who come to fix your computer or get your network working again, you may want to know. (Or if you're simply curious and open to learning new things.)

One thing's for sure—based on the definitions you'll see out there—for being so innocent sounding, localhost has to be the most difficult term to explain.

What is localhost? Part 1.

Do you want proof of that claim? Here's one definition of localhost you may find:

"The localhost is the default name describing the local computer address also known as the loopback address. For example, typing: ping localhost would ping the local IP address of 127.0.0.1 (the loopback address). When setting up a web server or software on a web server, 127.0.0.1 is used to point the software to the local machine."

What?

Even if you memorized those two sentences and repeated them daily, you'd still not know what the heck "localhost" means. (By the way, if you prefer those kind of highly technical definitions, just hop on the Internet...that's about all you'll get.)

Let's try to fix that by keeping it simple.

What is localhost? Part 2.

In computer networking talk, localhost refers to "this computer" or even more accurately "the computer I'm working on." IT types, network administrators and programmers, will even use the term "home" (home computer).

Take note: As mentioned before, localhost has little use if you're not a network type. In other words, if your kid doesn't like how slow his or her PC is running, they might say "I hate this computer," but they wouldn't say, "I hate localhost."

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?

Here's an analogy.

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.

Not just a name, but a number too.

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.

Some computer types can be seen wearing shirts that say "There's no place like 127.0.0.1."

Now, try this.

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.

Related Articles