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

Mail server not working when configured with IP address

SOLVED
Go to solution
vz7r1x
Regular Advisor

Mail server not working when configured with IP address

Hi All!
Sendmail works with host name but fails when I replace hostname with IP address in sendmail.cf
DSXXX.XXX.30.30

mail log output:
Apr 28 08:19:39 rookie sendmail[26344]: p3SCJcoB026342: p3SCJdoA026344: DSN: Host unknown (Name server: XXX.XXX.30.30: host not found)
-------
more /etc/nsswitch.conf
# /etc/nsswitch.conf:
#

hosts: files [NOTFOUND=continue] dns
passwd: files
group: files
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
-------
more /etc/resolv.conf
domain ABC.CDE.FGH.mil
nameserver XXX.XXX.20.11
nameserver XXX.XXX.20.12

/etc/hosts also has the entry for mail server.
XXX.XXX.30.30 mailServer.com mailServer

My mail server name changes frequently so we are asked to use IP.

Can you help?
Thanks
4 REPLIES
Bill Hassell
Honored Contributor

Re: Mail server not working when configured with IP address

Take a look at /etc/mail to see if you have a service.switch file. This file can specify how to resolve a hostname and IP and overrides resolv.conf.


Bill Hassell, sysadmin
Matti_Kurkela
Honored Contributor
Solution

Re: Mail server not working when configured with IP address

If you're going to use an IP address in the smarthost definition in sendmail.cf, put [square brackets] around the address.

i.e.

DS[XXX.XXX.30.30]

MK
MK
vz7r1x
Regular Advisor

Re: Mail server not working when configured with IP address

Thanks, sendmail is working great with your suggestion.
vz7r1x
Regular Advisor

Re: Mail server not working when configured with IP address

Thx