Re: localhost redux

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: localhost redux
Date: 2004-07-20 16:25:28
Message-ID: 20040720162528.GA27540@gp.word-to-the-wise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 20, 2004 at 08:32:00AM -0400, Tom Lane wrote:
> "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at> writes:
> >> I think you should first trace down what the problem really is --- is
> >> your system just misconfigured or is there some fundamental issue that
> >> we really ought to answer to?
>
> > The trouble on AIX is, that getaddrinfo only does a nameservice lookup,
> > no /etc/hosts.
>
> Wouldn't that break many other programs besides Postgres? But in any
> case if your nameserver doesn't resolve localhost, I'd say you'd better
> fix your nameserver. See eg, http://www.faqs.org/rfcs/rfc2606.html
>
> The ".localhost" TLD has traditionally been statically defined in
> host DNS implementations as having an A record pointing to the
> loop back IP address and is reserved for such use. Any other use
> would conflict with widely deployed code which assumes this use.

There is no requirement for a recursive resolver (local nameserver) to
have localhost hardwired to return 127.0.0.1. It's not even clearly a
good idea in all cases. If, though, the resolver returns anything for
localhost it must be 127.0.0.1 (or, presumably, ::127.0.0.1).

While many recursive resolvers do have localhost hardwired (to avoid
this sort of issue) relying on it may be overly brave.

It would be nice if the OP could check their recursive resolver to see
what it is returning for a query for localhost ('dig @<nameserver> localhost',
where <nameserver> is the nameserver listed in /etc/resolv.conf), just to
check whether the DNS vs non-DNS localhost thing is an issue at all. Also
whether they have /etc/netsvc.conf (IIRC) configured to use /etc/hosts
or not.

getaddrinfo() has had strange and unusual bugs on some older versions of
AIX, anyway, so it may not be a DNS issue at all.

Cheers,
Steve

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2004-07-20 16:25:38 Re: pg_config
Previous Message Gavin M. Roy 2004-07-20 15:39:15 Re: localhost redux