Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Host unknown (Name server: mailhost: host not found)

Status
Not open for further replies.

inunix

Technical User
Jul 30, 2002
53
0
0
US
Hi,
I'm trying to send email from our solaris server.
I tried the following command

usr/bin/mailx -s " GGGGGGGG " "xxx@abc.com" << EOF
> Sample message
> EOF

sending mail failed giving the following error message

550 5.1.2 xxx@abc.com... Host unknown (Name server: mailhost: host not found).

Our exchange server is enabled for SMTP relay.

Please advice. Thanks.
 
Does your host know how to reach abc.com?

My sendmail.cf has a section which looks like
Code:
# "Smart" relay host (may be null)
DSmyexchange.server

Check your settings

Ceci n'est pas une signature
Columb Healy
 
You either need "mailhost" in DNS, or defined in your [tt]/etc/hosts[/tt] file. You should be able to get a valid response back from [tt]nslookup mailhost[/tt]. If not, put an entry into your [tt]/etc/hosts[/tt] for [tt]mailhost[/tt] with the IP of your Exchange server.
 
Let me check the /etc/hosts. What should I do to let my host know how to connect to SMTP server.?

Do I need to do anything after changing the sendmail.cf?
 
In the first instance try
Code:
ping myexchange.server
This will determine whether the sending host know the IP address of the smtp server.
If that doesn't work add a line in /etc/hosts which looks like
Code:
192.168.0.1    myexchange.server #Comment part
and try the ping again, it should work this time
Now amend /etc/mail/sendmail.cf as per my earlier host and do a simple test like
Code:
echo hello world | mail me@mailserver
- it should work now.

Ceci n'est pas une signature
Columb Healy
 
I tried getting
$ ping 111.11.1.0
111.11.1.0 alive

is this okay to proceed.
 
Ok

Your ping proves you can see the mail server across the network
What happens when you try
Code:
ping abc.com

Ceci n'est pas une signature
Columb Healy
 
inunix, the error in your original post is that your sending machine couldn't locate the IP address of "[tt]mailhost[/tt]". Try the following...

From the system you are trying to send mail from, type "[tt]nslookup yourexchangeserver[/tt]". Put the name of your actual Exchange server. This will get you it's IP address. Is that the "[tt]111.11.1.0[/tt]" IP address you mention above? If so, add this line to your [tt]/etc/hosts[/tt] file...
Code:
111.11.1.0      mailhost
Or, whatever the actual IP address of the Exchange server is.

If that server is acting as an SMTP server, you should be able to send your mail now.

Also, you don't need to be able to [tt]ping abc.com[/tt] to send mail to it. The SMTP server you are using must be able to either reach it, or forward to a mail server that can reach it, but not your sending machine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top