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

Configure sendmail using DNS???

Ajay Arora
Occasional Visitor

Configure sendmail using DNS???

I have defined DS entry in sendmail.cf, it works fine if I kept an entry in /etc/hosts file but if I commentOUT hosts file entry and try to do telnet, it gives me an error unknown host? What should I do to use the DNS name rather than IP
4 REPLIES
Bill Hassell
Honored Contributor

Re: Configure sendmail using DNS???

The sendmail.cf DS macro only defines the name (or IP) of a smart relay host. It does not define anything about using DNS. There are 3 files that must be configured for DNS:

/etc/resolv.conf
/etc/nsswitch.conf
/etc/mail/sendmail.cw

resolv.conf will have the domain name for your network, while nsswitch.conf specifies how to resolve names and sendmail.cw defines the names that your local system might be called. resplv.conf and nsswitch.conf are required for normal DNS such as telnet and sendmail.

For resolv.conf, the format is something like this:

domain mydomain.com
nameserver 12.34.56.78
nameserver 23.45.67.89

Use this for nsswitch.conf:

passwd: files
group: files
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns
ipnodes: files [NOTFOUND=continue] dns
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files





Bill Hassell, sysadmin
Ajay Arora
Occasional Visitor

Re: Configure sendmail using DNS???

All the three files are configured as suggested and as I said before, if I uncomment the relay host IP entry in /etc/hosts/ file, it works. But Our preference would be to use the DNS name so that if there is a change in IP address in the future it will work
Tim Nelson
Honored Contributor

Re: Configure sendmail using DNS???

without an entry in the /etc/hosts file and if /etc/resolv.conf is confirgured correctly?

what happens if you nslookup or

if you do not get a successfull response then either your resolv.conf is wrong or there is no entry for this host your main DNS server.

fix that and you should be good to go.

(you do need to ask the mail admin to allow your mail forwarding, ya ,know )


Steven E. Protter
Exalted Contributor

Re: Configure sendmail using DNS???

Shalom,

In a Corporate environment DNS setup requires that port 25 be open to the public Internet to deliver mail to the domains. This port is almost never open.

Though if your requirement is to only deliver within the Corporate envionment the DNS style setup might work.

In general, HP-UX servers are configured to relay to a smtp or Exchange relay server.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com