Work with a dedicated server long enough and you are bound to see this rather odd-looking IP address. Do not panic, and do not start worrying that someone has hacked your brand new server. Most importantly of all, do not, under any circumstances, attempt to block this address.
For all intents and purposes, 127.0.0.1 is you, or more precisely, your server. Any activity conducted by this address is actually being conducted internally on the server, and any service that connects to that IP is connecting locally. For that reason, 127.0.0.1 is also known as “localhost”, and most servers have localhost set as one of the host names by default. On a Linux server, you can view the lists of host names by viewing the hosts file:
The localhost is the standard hostname for the nextwork interface called loopback. If you are unfamiliar with Linux network interfaces, you can view them by typing:
You should see one interface that looks like this:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:11970 errors:0 dropped:0 overruns:0 frame:0
TX packets:11970 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:7430494 (7.4 MB) TX bytes:7430494 (7.4 MB)
Because it is a way to interact locally with running services, many of them will run on localhost (127.0.0.1) in addition to an external IP address. Apache, MySQL, and others make use of it. For example, when setting a script that requires access to a MySQL database, it will ask for the host name. By using “localhost”, it will connect to the database without ever venturing outside of the server.