Forcing sendmail to use /etc/hosts before using DNS

John B. Hanks john.hanks at USU.EDU
Mon Jan 13 20:50:15 GMT 2003


I am trying to get sendmail/mailscanner to do something that has me
questioning my understanding of the way this has been working. Here is what
I currently do to scan mail for a mail server.

My MailScanner machines are noturus.usu.edu and ameiurus.usu.edu.

If I want to scan mail for mail.dept.usu.edu, I go to that DNS record and
add

mail.dept.usu.edu  in mx  10 noturus.usu.edu
mail.dept.usu.edu  in mx  10 ameiurus.usu.edu

This has been working flawlessly for some time. I think what happens is mail
gets delivered to the MailScanner machines, they recognize themselves as MX
hosts and then forward the scanned mail to the A record for the target.

Now I need to do some magic for a server move. I have a host,
someserver.usu.edu, that wants mail scanned and delivered to another box
which will host mail but someserver.usu.edu still has other functions so it
need to keep this name in its a record. I thought I could accomplish this by
adding entries to /etc/hosts on the mailscanners like

172.17.1.33      someserver.usu.edu 

So that when noturus or ameiurus looked up someserver.usu.edu they would use
the entry from the hosts file and unwittingly deliver mail to the new
server. But, sendmail seems intent on ignoring the /etc/hosts file. I have
changed /etc/resolv.conf, /etc/nsswitch.conf, /etc/host.conf and
/etc/mail/services.switch so that all these point to files first, then dns
but it still isn't working. The ping command works as expected, checking
/etc/hosts and using the IP address from the file. Can someone tell me if
what I want to do is possible and if so, how do I get sendmail to behave
this way? As we move more mailservers to use MailScanner this is going to
come up again and I need a way to solve it.

This is Redhat 7.3, MailScanner 4.11-1 and sendmail 8.11.6-15.

Thanks,

jbh




More information about the MailScanner mailing list