Operating System - HP-UX
1820619 Members
1790 Online
109626 Solutions
New Discussion юеВ

Re: Sendmail hostname lookup failure

 
Kusuma Sashidhar_2
Occasional Advisor

Sendmail hostname lookup failure

Hi,

My requirement is just to send mails from unix server (sendmail) to exchange server as a relay host. I don't want to allow sending mails to internet.

I don't want DNS lookup also. I am just giving relay server's ip address in DS entry in sendmail.cf and I have disabled DNS lookup entry through ResolverOptions=-DNSRCH.

But when I send mail, I get an error (Deferred: Name server: x.x.x.x: host name lookup failur)

Can you please guide me. This send mail is on Solaris.

Regards,
Kusuma
14 REPLIES 14
Joseph Loo
Honored Contributor

Re: Sendmail hostname lookup failure

hi,

u may try putting the hostname and ip address of the exchange server in /etc/hosts. change the relay host to DS then restart sendmail service.

also, u may like to check /etc/nsswitch.conf if the lookup for the hostname includes "files".

regards.
what you do not see does not mean you should not believe
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

Hi Joseph,

Thanks for replying.

I have tried all that u said.

My DS entry has the FQDN of exchange server

and my nsswitch.conf has hosts: files dns

But still the same problem.

Kusuma
Joseph Loo
Honored Contributor

Re: Sendmail hostname lookup failure

hi,

have u check if the hostname is resolve via nslookup ?

also, what is the response from:

# telnet 25

regards.
what you do not see does not mean you should not believe
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

Hi Joseph,

telnet exchangeserver 25 responds with

220 exchangeserver Microsoft ESMTP MAIL Service, Version: 5.0.2195.6713 ready at Thu, 10 Mar 2005 02:15:46 -0500

but nslookup exchangeserver says can't find hostname.

Rgds,
kusuma
Joseph Loo
Honored Contributor

Re: Sendmail hostname lookup failure

hi,

it looks like nsswitch.conf need some amendment. would u be using DNS to resolve any of the hostname, if not, remove dns, i.e.

hosts: files

and try nslookup again.

also, ensure that this is found in your /etc/hosts file.

regards.
what you do not see does not mean you should not believe
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

Joseph,

/etc/nsswitch.conf contains files dns for some other purpose. I don't want sendmail to lookup through DNS. that is the reason I have an exchange server entry in /etc/hosts file. And i have also disable dns lookup in sendmail.cf as I mentioned in my first query.

Do u know why it checks in DNS yet? How to disable that for sendmail alone?

Kusuma
Joseph Loo
Honored Contributor

Re: Sendmail hostname lookup failure

hi,

how about posting /etc/resolv.conf? do u have something like this example:

domain abc.com
nameserver 123.123.123.123

regards.
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: Sendmail hostname lookup failure

hi,

just remember something:

did u also remember uncommenting Dj$w.Foo.COM to:

Dj$w.abc.org

regards.
what you do not see does not mean you should not believe
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

one thing is I have nameserver x.x.x.x in /etc/resolv.conf. But I am looking at sendmail not to look at DNS.

I have uncommented Dj

One more thing is, i see in one of ITRC- links that someone says put IP address followed by DS in square brackets. I just tried that. but then it says it has delivered the message in to queue and I can't see anything in the queue and I don't receive mails also..

Kusuma
Joseph Loo
Honored Contributor

Re: Sendmail hostname lookup failure

hi,

resolving the hostname of the exchange server providing the smtp service have to work before you get sendmail to work. nslookup will determine if you have done so.

i am not too sure about putting IP address to the DS macro but if you will saying this works? also, like to confirm if you have place the hostname and correct IP address in /etc/hosts.

if the mail is queuing, use command, mailq to check.



regards.
what you do not see does not mean you should not believe
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

I have tried both IP address and hostname, but i get the same results. when i say mailq, it displays

(Deferred: Name server: exchangeserver.com: host name lookup failure)


Kusuma
Jose Mosquera
Honored Contributor

Re: Sendmail hostname lookup failure

Hi,

A little brief:

1.- Define in your /etc/hosts file an alias for your smtp relay server:
xx.xx.xx.xx my_smtp_relay

Test it the alias resolution (i.e: ping my_smtp_relay)

2.- Configure in your /etc/mail/sendmail.cf file the previuos relay into the "Smart relay host" section:
DSmy_smtp_relay

3.- Restart the sendmail service:
#/sbin/init.d/sendmail stop
#/sbin/init.d/sendmail start

4.- Try sending a test message:
#echo "Test One"|/usr/sbin/sendmail -v mailbox@domain

5.- A trick to define a unreachable external domain is add it into /etc/hosts file aim to the relay's IP, i.e:
xx.xx.xx.xx pepsi.com

Where xx.xx.xx.xx is the same relay_server and external domain IP.

Rgds.
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

Hi Jose,

Have tried the sameway.

It still has hostname lookup error. The same configuration works on linux but not on solaris.

Rgds,
Kusuma
Kusuma Sashidhar_2
Occasional Advisor

Re: Sendmail hostname lookup failure

Hi,

Sendmail worked with new set of probs. Thanks for all the help.

I shall open a new thread for new problems.

Regards,
Kusuma