Jul
4
Published by Kieran in Computer Science
· Leave your thoughts
( words)
( words)
By default, Sendmail uses DNS for name resolution, not the /etc/hosts file. The behaviour can be changed using one of the below methods:
- If you wish to query the hosts file before DNS servers, create a /etc/mail/service.switch file which contains the following line:
hosts files dns
If you wish to query ONLY the hosts file, use the following:
hosts files
Send Sendmail a HUP signal:
kill -HUP `head -1 /var/run/sendmail.pid`
and the changes will take effect.
- Open (or create if it doesn’t exist the file /etc/mail/mailertable) and add:
hostname-thats-not-working.com esmtp:[ip.addr.addr.addr]
Then rebuild mailertable running:makemap hash /etc/mail/mailertable < /etc/mail/mailertable
This should take immediate effect – no need to alter the running process.
Jobs a gooden!
If you then wish to force any deferred mail currently in the queue you can use:sendmail -OTimeout.hoststatus=0m -q -v
This ensures that the cached DNS is ignored, and the new IP address is looked up.