Question

removed 127.0.1.1 hostname hostname from /etc/hosts after installing sendmail/ubuntu

Posted July 7, 2015 9.8k views
UbuntuPHPLinux Commands

Hi,

I’ve installed sendmail in ubuntu, bit sending email was deadly slow.
In the file /etc/hosts there was 127.0.1.1 HOSTNAME HOSTNAME
I changed this to
127.0.0.1 localhost localhost.localdomain HOSTNAME

so 0.1 instead of 1.1 and sendmail was super quick.

Is it a problem that my hostname is not listing to 127.0.1.1 anymore??

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

There shouldn’t be an issue with that as 127.0.1.1 is bound to the loopback interface. It’s a Debian/Ubuntu specific implementation detail really. See this section on hostname resolution from the Debian Reference guide:

The IP address 127.0.1.1 in the second line of this example may not be found on some other Unix-like systems. The Debian Installer creates this entry for a system without a permanent IP address as a workaround for some software (e.g., GNOME) as documented in the bug #719621.

The <host_name> matches the hostname defined in the “/etc/hostname”.

For a system with a permanent IP address, that permanent IP address should be used here instead of 127.0.1.1.

For a system with a permanent IP address and a fully qualified domain name (FQDN) provided by the Domain Name System (DNS), that canonical <host_name>.<domain_name> should be used instead of just <host_name>.

Submit an Answer