whatis localhost

Localhost (Loopback)

Also known as: 127.0.0.1, ::1, lo

The hostname that always refers to the current machine, mapped to 127.0.0.1 and ::1 on the virtual loopback interface lo.

What Is Localhost (Loopback) in Linux?

Traffic sent to localhost never leaves the machine. Services that bind only to 127.0.0.1 are reachable locally but invisible to the network, which is a common and effective way to keep a database or admin panel private.

A service bound to 0.0.0.0 listens on every interface instead. ss -tlnp shows which address each service is listening on.

Example

ss -tlnp | grep 127.0.0.1