Discussion:
valid_hostname errors - trailing dot safe to remove from /etc/hos
(too old to reply)
Stewart, John
2006-03-30 16:07:53 UTC
Permalink
I've noticed the "misplaced delimiter errors" since upgrading from 2.0.13 to
2.2.9 this weekend:

Mar 29 20:55:51 bratwurst postfix/smtpd[25492]: [ID 947731 mail.warning]
warning: valid_hostname: misplaced delimiter: megatron.heurikon.com.
Mar 29 20:55:51 bratwurst postfix/smtpd[25492]: [ID 197553 mail.info]
connect from unknown[10.64.16.23]
Mar 29 20:55:51 bratwurst postfix/smtpd[25492]: [ID 197553 mail.info]
disconnect from unknown[10.64.16.23]

And apparently specifying the trailing dot is invalid: (?)

http://marc.theaimsgroup.com/?l=postfix-users&m=97177510602681&w=2

We specify in /etc/hosts on our postfix mail gateway the machines internally
(including megatron in the above example) so postfix can resolve them even
if DNS falls down.

I was always trained to specify the trailing dot so the default domain will
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?

johnS
Victor Duchovni
2006-03-30 17:28:29 UTC
Permalink
Post by Stewart, John
I was always trained to specify the trailing dot so the default domain will
not be appended mistakenly. So on our Solaris 2.9 system in /etc/hosts I
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?
There are two resolver options that control the automatic addition of
default domains. From the res_search() manpage:

RES_DEFNAMES
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].

RES_DNSRCH
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.
--
Viktor.

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:
<mailto:***@postfix.org?body=unsubscribe%20postfix-users>

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.
a***@gmail.com
2014-05-23 11:10:33 UTC
Permalink
Post by Victor Duchovni
Post by Stewart, John
I was always trained to specify the trailing dot so the default domain will
not be appended mistakenly. So on our Solaris 2.9 system in /etc/hosts I
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?
There are two resolver options that control the automatic addition of
RES_DEFNAMES
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].
RES_DNSRCH
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.
--
Viktor.
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
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.
Heh, thanks for this. It was the exact information I needed, even eight years later. The magic of the Internet.
Loading...