How to Configure Sendmail not to Look up MX records
Article Number: 563 | Rating: Unrated | Last Updated: Fri, Apr 19, 2019 2:28 PM
A default sendmail configuration will do DNS queries for MX records. It does this even when its setup to use a Mail Relay Server for sending mail out. This will cause mail to fail if its not able to lookup the MX record, for example when the SMTP relay server is not known in DNS.
Setting up sendmail not to query DNS for MX records when using a DS (Smart Relay) consists of using "[ ]" brackets around the hostname (or IP address) Mail Relay Server configured in the /etc/mail/sendmail.cf.
To do so, edit the sendmail configuration file:
# vi /etc/mail/sendmail.cf
Search for the DS entry. For example:
DSsmtp.unixhealthcheck.com
Change it to:
DS[smtp.unixhealthcheck.com]
Then save the configuration file, and refresh sendmail:
# refresh -s sendmail