Technical article 107669

How do I configure sendmail for an intranet environment without DNS?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.5

Written · Last revised

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.switch

4. Create a file /etc/service.switch which contains a single line:

hosts files

NOTE: 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.switch
6. kill the current sendmail daemon:
ps -ef | grep sendmail
kill <sendmail-pid>
7. Manually restart the sendmail daemon:
/usr/lib/sendmail -bd -q1h

To 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)

From the Xinuos technical article database, record 107669. Reproduced with permission. The original is at www.sco.com/ta/107669, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.