Skip to main content.

2006-Dec-29

gethostbyname of localhost returns the first hostname defined in /etc/hosts. If you want to have a valid hostname, then put that as the first one. For example, I moved "localhost." with a trailing period to be first value for 127.0.0.1. (I have had this problem before but didn't document here.) I noticed this time when using Perl's Mail::Sendmail module to mail. The default HELO was not accepted by some mail servers.