Localhost IP
The IP address 127.0.0.1 is normally used for localhost. The IPs 127.0.0.1 through 127.255.255.255 are reserved for localhost. These extra addresses are rarely used.IPv6 Localhost
The IPv6 address ::1 is reserved for localhost. This is the only address for localhost under IPv6.Localhost Address
The localhost address can be resolved by the domain name system (DNS). However, it is a good practice for hosts to resolve this internally. This has benefits to the host in terms of speed and information security. It also prevents the domain name system from being overwhelmed by localhost lookups. An extremely large number of requests are generated for localhost as it is a common way for systems and applications on your computer to talk to each other.Host File
A host file is a configuration file that allows you to override the IP for hostnames. It is a good practice to put the following line in your host file to prevent localhost from being looked up in DNS:127.0.0.1 localhostIt is also possible to use add other hostnames to the host file that map to 127.0.0.1. This is a common way for developers to test code locally using a domain name.Localhost vs Private IP
A private ip is an IP address that isn't open to the internet. This is used to communicate to machines on a private network such as a local area network ( LAN). It is a common mistake for software to request local resources using the local machine's private IP. This has security and bandwidth implications as such requests are handled with a network interface.Localhost vs Public IP
A public IP is an IP address that is exposed to the internet. It is a poor practice to request local resources with your machine's public IP as such requests are exposed to the internet.Loopback
Requests made to localhost use a special device known as a loopback. A loopback device handles requests locally without hitting any connected networks.Example
Music mixing software connects to synthesizer software on localhost. This allows the software to be stable when there is no network connection. It also doesn't consume any bandwidth. The synthesizer is more secure because it only listens to 127.0.0.1 and can't be reached from the internet.Overview: Localhost | ||
Type | ||
Definition | A network address that is used to allow a computer or device to communicate to itself. | |
Related Concepts |