Messaging
cancel
Showing results for 
Search instead for 
Did you mean: 

forcing sendmail to use /etc/hosts to lookup the Smart Relay Host

avsrinivas_1
Occasional Advisor

forcing sendmail to use /etc/hosts to lookup the Smart Relay Host

Dear All
We have a HP-UX 10.20 system with sendmail, configured to use a relay host to deliver all the external mails. This is set by modifing DS entry in sendmail.cf file.
The relay host ip address is available in the
/etc/hosts file and pings as well by name. But when we try to send mails, it gives name server problem. This works fine after installing DNS and adding the relay host entry to DNS.

Can we force sendmail to use /etc/hosts instead of using DNS to lookup for relay host.
I have tried with /etc/nsswitch file also.

Is there any other procedure to make sendmail to deliver all the external mails to a relay host.
Be Dynamic
3 REPLIES
Laurent Paumier
Trusted Contributor

Re: forcing sendmail to use /etc/hosts to lookup the Smart Relay Host

Try adding this line to your /etc/nsswitch.conf :
hosts: files dns
It works fine here.
Laurent Paumier
Trusted Contributor

Re: forcing sendmail to use /etc/hosts to lookup the Smart Relay Host

Oops.. my last answer works on linux, not hpux... For hpux, you have to tell it to continue if host was not found :
hosts: files [NOTFOUND=continue] dns
Kurt Beyers.
Honored Contributor

Re: forcing sendmail to use /etc/hosts to lookup the Smart Relay Host

To operate sendmail in topologies with /etc/hosts only (without DNS and
without NIS), make the changes listed below.

1. Change/enter the "hosts" entry in the file /etc/nsswitch.conf:
hosts: files

2. In the file /etc/mail/sendmail.cf, uncomment the following options:

O TryNullMXList


Prior to HP-UX 8.x sendmail, sendmail would try to connect to a host directly if there were no MX records for the destination. To revert to this behavior, you must uncomment the option TryNullMXList.

Uncomment and Define:

Dj$w.foo.bar

Replace foo.bar with what would be considered the domain part of your host name. For example:

Dj$w.cup.hp.com


Stop and start sendmail, it should work now

Kurt