System Administration Guide: Resource Management and Network Services

How to Use DNS With sendmail

The DNS name service does not support aliases for individuals. This name service does support aliases for hosts or domains that use Mail Exchange (MX) records and cname records. You can specify host names, domain names, or both names in the DNS database. For more information about sendmail and DNS, see Interactions of sendmail With Name Services in Chapter 26, Mail Services (Reference), or see the System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP).

  1. Become superuser or assume an equivalent role.

    For information about roles, refer to “Using Privileged Applications” in System Administration Guide: Security Services.

  2. Enable DNS host lookups (NIS+ only).

    Edit the /etc/nsswitch.conf file and remove the # from the hosts definition that includes the dns flag. The host entry must include the dns flag, as the following example shows, in order for the DNS host aliases to be used.


    # grep hosts /etc/nsswitch.conf
    #hosts:     nisplus [NOTFOUND=return] files
    hosts:      nisplus dns [NOTFOUND=return] files
  3. Check for a mailhost and mailhost.domain entry.

    Use nslookup to ensure that an entry exists for mailhost and mailhost.domain in the DNS database. For more information, refer to the nslookup(1M) man page.