what does 127.0.1.1 mean

cat /etc/hosts

127.0.0.1 localhost
127.0.1.1 docker-slv-2vcpu-4gb-sgp1-01

I know 127.0.0.1 is the loopback address. What does 127.0.1.1 mean ?

It doesn't really mean anything in particular (it's just another IP in the 127.0.0.0/8 block).

The reason it's used as the IP for your hostname is explained in Section 10.4 of the Debian Reference Manual. Quote: Some software (e.g., GNOME) expects the system hostname to be resolvable to an IP address with a canonical fully qualified domain name. This is really improper because system hostnames and domain names are two very different things; but there you have it. In order to support that software, it is necessary to ensure that the system hostname can be resolved. Most often this is done by putting a line in /etc/hosts containing some IP address and the system hostname. If your system has a permanent IP address then use that; otherwise use the address 127.0.1.1.

参考链接

  • https://serverfault.com/questions/925136/difference-between-127-0-0-1-and-127-0-1-1
  • https://www.linuxquestions.org/questions/linux-networking-3/what-does-127-0-1-1-mean-623421/
Last Updated: 11/6/2020, 10:54:10 AM