Name
$=w
Synopsis
Before the sendmail
program reads its configuration file, it calls
gethostbyname(3) or
getipnodebyname(3) to find all the known aliases
for the local machine. The argument given to
gethostbyname(3) or
getipnodebyname(3) is the value of the
$w macro that was derived from a call to
gethostname(3) ($w).
Depending on the version of sendmail you are
running, the aliases that are found will be either those from your
/etc/hosts file or those found as additional
A or AAAA records in a DNS
lookup. Then, depending on the DontProbeInterfaces
option (DontProbeInterfaces), sendmail
will round out that picture by examining (probing) each network
interface and extracting from it the associated IP address or
hostname.
To see the aliases that sendmail found, or to
see what it missed and should have found, use the
-d0.4 debugging switch (-d0.4). Any aliases that are found are printed as:
aka: aliasDepending on your version of sendmail, each alias is either a hostname (such as rog.stan.edu) or an IPv4 address (such as [123.45.67.8]), or an IPv6 address (such as [IPv6:2002:c0a8:51d2::23f4]).
Many sendmail.cf files use the
$=w class macro to
define all the ways users might reference the local machine. This
list must contain all names for the local
machine as given in the /etc/hosts file, all
names for the local host as listed in DNS (including CNAME and MX
records), and the names associated with your network interfaces. For
example:
# All our routing identities Cw server1 server2 # All ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access