Sendmail: "unqualified hostname unknown; sleeping for retry unqualified hostname

Transfered from Linux Config Disqus comments:

Question:
Sendmail hang or is very slow when sending an email.

debian sm-mta[8129]: My unqualified host name (debian) unknown; sleeping for retry

Operating System:
Linux
Solution:
sendmail is searching for a FQDN ( fully qualified domain name ). In our case the host name is “debian” and that is not a FQDN. To resolve this problem change /etc/hosts:
FROM:

127.0.0.1       localhost
127.0.1.1       debian

TO

127.0.0.1       localhost.localdomain localhost debian
127.0.1.1       debian

Where “debian” is a hostname.