previous next contents

DNS and Mail


The successful delivery of SMTP mail relies on one SMTP mailer (such as sendmail) being able to pass messages to the "next hop" mailer in the chain. The determination of which mailer is the next hop, is where DNS comes into play. The majority of ISP's provide a mail "smarthost", to which their users can send all their mail. The provision of such a service shields the users from having to deal with the complexities of MTA's like sendmail.

To illustrate the manner in which a mailer determines the next hop with the DNS, consider the steps that are taken when sendmail on mail.linux.org attempts to deliver a message addressed to a user at microsoft.com.

Each domain that can accept mail should have one or more MX records entered in the DNS. Remote machines will send mail to these MX hosts, using the lowest priority host that can be reached. The absence of MX records will result in delivery attempts being made based on DNS A records (if they exist), and this removes the ease of administration and backup mail host facilities provided by the use of MX records.

Sendmail also uses DNS to determine its own host name, and to canonicalize host names during the delivery process. To be able to sucessfully use DNS, sendmail must have been compiled with DNS support. There used to be "no DNS" configuration option for sendmail, but in recent sendmail versions, this option, while still in existence, doenn't actually do anything - it is provided for compatibility only. The only situation where you might want to use sendmail without DNS today would be for a "dumb" configuration that simply forwards all mail to an external smarthost, or a sendmail that is used in an environment without SMTP (e.g. UUCP only).


previous next contents