Loading ...
Sorry, an error occurred while loading the content.
 

Re: valid_hostname errors - trailing dot safe to remove from /etc/hos ts?

Expand Messages
  • Victor Duchovni
    ... There are two resolver options that control the automatic addition of default domains. From the res_search() manpage: RES_DEFNAMES If set, res_search()
    Message 1 of 2 , Mar 30, 2006
      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 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?

      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:majordomo@...?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.
    Your message has been successfully submitted and would be delivered to recipients shortly.