Problem
I need to configure sendmail (8.8.4) to deliver mail to hosts on
my intranet. Sendmail by default attempts to resolve via DNS.
Commenting out the 'OI' line in the sendmail.cf and restarting
the sendmail daemon does not resolve this issue.I receive the following message:message is deferred: hostname lookup failure Solution
One solution to this issue is as follows. As root:1. Rename /etc/resolv.conf to /etc/resolv.conf.bak, if it exists.
2. Validate that the /etc/hosts file is up-to-date, and accurate on all hosts.
3. Edit /usr/lib/sendmail.cf as follows:(a) Ensure that the OI entry in the OPTIONS section is is changed as follows:
OI-DNSRCH(b) Add another entry immediately after the OPTIONS heading.
# Service.Switch to eliminate DNS lookup
O ServiceSwitchFile=/etc/service.switch4. Create a file /etc/service.switch which contains a single line:
hosts filesNOTE: The word 'hosts' is followed by a space and the word 'files'.
5. The permissions and owner/group on /service.switch are:
chown bin:bin /etc/service.switch
chmod 644 /etc/service.switch6. kill the current sendmail daemon:ps -ef | grep sendmail
kill <sendmail-pid>7. Manually restart the sendmail daemon:/usr/lib/sendmail -bd -q1hTo test and troubleshoot the changes, invoke:
/usr/lib/sendmail -v <user>@<hostname>NOTE: This solution should work with any Sendmail 8.7.6 or later. See also
sendmail(ADMN), mail(C)