Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 2003 01:46:11 +0930
From:      "W. Sierke" <ws@senet.com.au>
To:        "Ryan Merrick" <sandshrimp@attbi.com>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: localhost name resolution problem
Message-ID:  <025201c2f86a$048f09a0$0264a8c0@regional.net.au>
References:  <024501c2f7c6$080ab560$0264a8c0@regional.net.au> <3E88C792.5020906@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
From: "Ryan Merrick" <sandshrimp@attbi.com>
> W. Sierke wrote:
> >hosts contains
> >::1 localhost.my.domain localhost
> >127.0.0.1 localhost.my.domain localhost
> >192.168.100.1 this_machine.my.domain this_machine
> >192.168.100.2 another_machine.my.domain another_machine
> >...
>
> Your #/etc/hosts file should read for IPv4 localhost
> 127.0.0.1    localhost.Your_local_domain.com localhost
>
> There should be another line in #/etc/hosts your host
> 192.168.100.1    My_host.Your_local_domain.com My_host
>
> You can add as many lines as you want. with IP address, hostname,
nickname.

Indeed, but despite the presence of the (IPv4) localhost entry, sendmail was
resolving localhost to my internet IP address, rather than 127.0.0.1.

It was suggested to me that the name resolution method that sendmail uses
would not use /etc/hosts anyway and since that matched my own experience I'm
inclined to think it's true, that's why I resorted to adding bind to the
system.

After further investigation I've seen two approaches to resolving this
issue, one to substitute 127.0.0.1 in place of 'localhost' in the sendmail
config files[1], the other to add the sendmail config file
/etc/mail/service.switch with the line "hosts files dns".

But now I'm curious about why these options aren't used in the default
installation of sendmail on FreeBSD, given that my situation doesn't appear
to be unusual. Does sendmail not use the hosts file by default as a security
measure? In any case it just feels "dirty" to me to have to circumvent this
issue on a case-by-case basis - i.e. my thinking at the moment is that a dns
facility should resolve 'localhost' correctly. Is that a shared sentiment?
Or am I just barking up the wrong tree altogether?


Thanks,

Wayne

[1] - by having FEATURE(`msp', `[127.0.0.1]') in submit.mc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?025201c2f86a$048f09a0$0264a8c0>