host address in Debian (Ubuntu) hosts file

Sometimes the/etc/hosts file will see the address What is this this loopback address is very common, which is the loop/loopback address of the local interface. But sometimes will appear in the/etc/hosts file. What is the address?This is also a local loop/loopback address.

The reason for this address is that some applications need a fully qualified domain name (FQDN). FQDN requires not only the host name but also the host domain name. Its expression is hostname.domainname

If your host has a static IP address, the FQDN name will be resolved to the static address, otherwise it will be resolved to the local loop address So generally, you won’t see only corresponds to the host name, which is the main difference between the two, as follows hostname hostname.domainname

Of course, it is not necessary to use the IP. Any IP in the IP segment specified in RFC can be used. As long as there is no conflict, Debian chooses

View the host name
# host name
host name

View the FQDN name
# host name – FQDN

Similar Posts: