Sendmail configuration to support rDNS change

My ISP kindly agreed to make the rDNS lookup of my one static IP address point to my own domain. We settled on as a generic name. I added to my DNS records on DynDNS. What I then needed to do was persuade sendmail to use that domain name for outgoing mail, so that a rDNS lookup would be consistent. My mail server's name is crimson, and I didn't want to change that.

The /etc/nsswitch.conf file on crimson specifies that files come before DNS for lookups. I could take advantage of this and placed as the first fully qualified name in /etc/hosts against

Then, running a sendmail -d0.4 command resulted in:

  Canonical name:
   UUCP nodename: crimson
          a.k.a.: crimson
          a.k.a.: []

  ============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = mail
  (canonical domain name) $j =
         (subdomain name) $m =
              (node name) $k = crimson

Now sendmail was using as it's domain name, while I could still refer to the machine as crimson internally.

Sending mail to external recipients worked just fine. However, sending mail to other machines on the local network failed, as was not defined in the local DNS. Hmm, I could define the domain name I suppose, but I could also use sendmail re-writing rules to make the sending address the real host name, rather than Since I already had special configuration setup for local mail this was relatively easy. I added a new re-writing rule:

  R$+ @ mail $*   $1 @ $k $2      replace generic mail hostname with real node name

for both the rulesets SEnvFromSMTPNET and SHdrFromSMTPNET. Mail on the internal LAN was now working again.