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

Sendmail - Name lookup failure

Ste Weston
Occasional Visitor

Sendmail - Name lookup failure

I am encountering a problem with configuring sendmail on a few systems.

The systems are all running HPUX 10.20 and 11.00, running sendmail based on versions 8.8.6 and 8.7.1.

I am getting a name lookup failure for the mail relay server 'mailhost'.
This is despite being able to successfully ping the mail server, and also 'manually' transmit mail by telnet'ing to port 25 on the mail server, then inputting the sender, recipient and data fields.

Error received:
Deferred: Name server: mailhost: host name lookup failure


I have used some sendmail diagnostics to verify that the email address that I am sending to (myself) is being parsed correctly by the .cf file, so it only seems to be this 'name lookup failure'

I have also confirmed that the server 'mailhost' can be looked up (nslookup) using the server's host file, although I do have nsswitch.conf set to use files, then DNS for name resolution.


I feel that there is probably something very silly that I have not checked, but I'd appreciate the advice. Cheers

6 REPLIES
Steven E. Protter
Exalted Contributor

Re: Sendmail - Name lookup failure

Shalom Ste,

Default sendmail depends on domian name resolution and internet access to deliver mail.

If you have nslookup for the domain name, sendmail should be able to deliver mail.

You should be able to upgrade sendmail itself to around 8.9 in depot form, but you may need to get the depot from your HP Representive.

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
Jeff_Traigle
Honored Contributor

Re: Sendmail - Name lookup failure

Not sure if the older versions were like this, but the version on 11.11 has a separate file from nsswitch.conf that sendmail uses to determine how to resolve names. It's /etc/mail/service.switch.
--
Jeff Traigle
Ste Weston
Occasional Visitor

Re: Sendmail - Name lookup failure

Thanks for yoour replies gents, I appreciate the suggestions.

I have one system running 8.7.1 that works OK, and will mail externally, so I am loathe to upgrade all of my versions, because I know that this one works OK.

I have checked the service.switch file, which did list the resolving order as:
hosts dns files
I have now edited this to show:
hosts files
and killed and restarted the sendmail daemon
(killsm, then sendmail -bd)

I still have the same lookup failure as before:

Deferred: Name server: mailhost: host name lookup failure
Steven E. Protter
Exalted Contributor

Re: Sendmail - Name lookup failure

I don't really thing its the sendmail version.

Please try this test:


nslookup yahoo.com

if you get a valid answer, then try and use elm to send mail to someone@yahoo.com

Then check the mail.log file in /var/adm/syslog

If you get the same error, I'm wrong, go find a better sendmail version.

If you fail to get a valid answer from nslookup for yahoo.com or hp.com, et al then work on the system until you get valid hostname resolution.

checklist

Make sure you have dns as an option in /etc/nsswitch.conf and that it gets tried. nslookup should say "Trying DNS" before it fails. If it doesn't change nsswitch.conf until it does.

Make sure you can ping the name servers in /etc/resolv.conf

Make sure you have valid name servers in /etc/resolv.conf

Make sure you can ping your GATEWAY, shown perhaps in ifconfig lano or in /etc/rc.config.d/netconf

If you feel the need to edit netconf don't make a backup in /etc/rc.config.d it will get processes and make your networking unstable.

If hostname resolution is not working, you must get it working before taking other steps.

Shortcut:

add this to sendmail.cf on the broken servers.

DShostnameofworkingserver

or

DS
[ip address of working server]

Make sure the /etc/mail/access list on the working server allows RELAY from the server we are working on.

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Diagnostic:

mailq

sendmail -v -d8.99 -d 38.99 someone@hp.com

type some text

.


Good Luck,

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
Sameer_Nirmal
Honored Contributor

Re: Sendmail - Name lookup failure

Hi,

Try by un-commenting the following line from /etc/mail/sendmail.cf

#O ServiceSwitchFile=/etc/mail/service.switch

Then restart sendmail using,

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start
Ste Weston
Occasional Visitor

Re: Sendmail - Name lookup failure

Again, thanks for your feedback gents.
- I have been off for a couple of days, so only just picked up your latest advice.

Following SEP's useful update on running low level diags on the error, I have checked the sendmail output from my system that works (W), versus one that doesn't (X).

Respective output from each - this output appears when attempting to connect to the mail relay server

NB: I have already verified that I can manually (telnet mailhost 25) connect to the mail relay from EITHER system and successfully send mail externally.

The problem feels like some kind of name resolution issue, but I know that both servers will resolve the 'mailhost' server using /etc/hosts.


(W) output:
===========

checkcompat(to=XXXXXX@hotmail.com, from=root)
openmailer: IPC mailhost
XXXXXX@hotmail.com... Connecting to mailhost via relay...
makeconnection (mailhost [XX.XX.XX.XX])
makeconnection: fd=9
smtpinit MCI@4008d01c: flags=4,
errno=0, herrno=0, exitstat=0, state=1, pid=0,
maxsize=0, phase=initial connection, mailer=relay,
status=NULL, rstatus=NULL,
host=mailhost, lastuse=Thu Dec 1 16:03:43 2005


(X) output:
===========

checkcompat(to=XXXXXX@hotmail.com, from=root)
openmailer: IPC mailhost
openmailer: MCI@4003f44c: flags=0,
errno=238, herrno=2, exitstat=75, state=0, pid=0,
maxsize=0, phase=NULL, mailer=relay,
status=NULL, rstatus=NULL,
host=mailhost, lastuse=Thu Dec 1 15:49:50 2005

XXXXXX@hotmail.com... Deferred: Name server: mailhost: host name lookup failure
dropenvelope 4001cc60: id=PAA03120, flags=201023
sendto: root
ctladdr=[NULL]