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, 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
Bill Hassell
Honored Contributor

Re: Configure sendmail using DNS???

The 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:


resolv.conf will have the domain name for your network, while nsswitch.conf specifies how to resolve names and 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:


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???


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.

Steven E Protter
Owner of ISN Corporation