This article is from the Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems. Maintained by David C. Merrill with numerous contributions by others. (v1.0).
A: Make sure that Sendmail can resolve your hostname to a valid (i.e., parsable) domain address. If you are not connected to the Internet, or have a dial-up connection with dynamic IP addressing, add the fully qualified domain name to the /etc/hosts file, in addition to the base host name; e.g., if the host name is bilbo and the domain is bag-end.com:
192.168.0.1 bilbo.bag-end.com bilbo
And make sure that either the /etc/host.conf or /etc/resolv.conf file contains the line:
Caution Do not change the localhostentry in /etc/hosts, because many programs depend on it for internal message-passing.
Sendmail takes many factors into account when resolving domain addresses. These factors, collectively, are known as, "rulesets", in sendmail jargon. The program does not require that a domain address be canonical, or even appear to be canonical. In the example above, bilbo. (note the period) would work just as well as bilbo.bag-end.com. This and other modifications apply mainly to recent versions.
Prior to version 8.7, sendmail required that the FQDN appear first in the / etc/hosts entry. This is due to changes in the envelope address masquerade options. Consult the sendmail documents.
If you have a domain name server for only a local subnet, make sure that "." refers to a SOA record on the server machine, and that reverse lookups (check by using nslookup) work for all machines on the subnet.
Finally, FEATURE configuration macro options like nodns, always_add_domain, and nocanonify, control how sendmail interprets host names.
The document, Sendmail: Installation and Operation Guide, included in the doc / subdirectory of Sendmail source code distributions, discusses briefly how Sendmail resolves Internet addresses. Sendmail source code archives are listed at: http://www.sendmail.org/