Re: DNS vs /etc/hosts - Mailing list pgsql-general

From Michael Fuhr
Subject Re: DNS vs /etc/hosts
Date
Msg-id 20050804224922.GA90868@winnie.fuhr.org
Whole thread Raw
In response to Re: DNS vs /etc/hosts  (Lowell.Hought@faa.gov)
List pgsql-general
On Thu, Aug 04, 2005 at 04:39:02PM -0500, Lowell.Hought@faa.gov wrote:
> The difference must have to do with the functions that differ in the
> different versions of psql.  In looking through the code for version 8.0
> in the file /interfaces/libpq/ip.c, the function that resolves hostname is
> "getaddrinfo".  Is this the same function that was used in version 7.2,
> and if not, how does it differ?  Is there something on my machine that I
> can configure?

Good catch -- the use of getaddrinfo() appears to have been added
in 7.4.  I see calls to inet_aton() and gethostbyname() in earlier
versions, so maybe that explains the difference.  A simple test
program should be able to confirm or refute that hypothesis.  The
tcpdump output I suggested in another message should show exactly
what queries are being made and what responses are being received.

Different systems have different resolver customizations; you'll
have to check your local documentation.  I'd start with "man
resolv.conf".  I'd especially look for options that control if and
when queries for the top-level domain "hostname" are made when
queries for "hostname.domain" fail.  You might also want to examine
your domain search list.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: DNS vs /etc/hosts
Next
From: Jaime Casanova
Date:
Subject: Re: What causes lock?