Re: valid_hostname errors - trailing dot safe to remove from /etc/hos ts?
- On Thu, Mar 30, 2006 at 10:07:53AM -0600, Stewart, John wrote:
> I was always trained to specify the trailing dot so the default domain willThere are two resolver options that control the automatic addition of
> not be appended mistakenly. So on our Solaris 2.9 system in /etc/hosts I
> have an entry:
> 10.64.16.23 megatron.heurikon.com.
> But if I remove the trailing dot, don't I run the risk that this hostname
> will be interpreted as megatron.heurikon.com.heurikon.com? Or is this just
> an idiosyncracy from the past?
default domains. From the res_search() manpage:
If set, res_search() will append the default domain name to sin-
gle component names, ie. those that do not contain a dot.
[Enabled by default].
If set, res_search() will search for host names in the current
domain and in parent domains. This option is used by gethostby-
name(3). [Enabled by default].
When Postfix does MX lookups, it disables both flags. When Postfix
maps hostnames to addresses via DNS lookups, it enables RES_DEFNAMES,
but not RES_DNSRCH.
So you don't need the trailing "." unless you specify "smtp_host_lookup
= ... native ..." and hostname lookup in nsswitch.conf includes "dns".
Even then there is generally no harm so long as you list "files, dns" in
nsswitch.conf. I have never been compelled to append "." to hostnames in
/etc/hosts. I have only ever used these (occasionally) on the command-line.
Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.
To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.