[ntp:questions] Pool returns IPv6 address to IPv4 query

Danny Mayer mayer at ntp.org
Tue Nov 19 16:01:36 UTC 2013

That must have been a short discussion. getaddrinfo() has nothing to do
with the IP stack. getaddrinfo()'s job is to get information from the
nameservers you specify in resolv.conf or wherever else the OS has that
information. Its job is NOT to make decisions about what it should ask
for. That's the programmer's job when setting up the API call as to what
addresses to ask for.

Would you like dig, nslookup, host, etc. to not give you all the
information when you are analyzing a problem? (the BIND versions use
their own internal versions of getaddrinfo, I am using these as an example).

Applications and Servers can make their own decisions about what data to
fetch and use, not getaddrinfo's.


On 11/19/2013 9:02 AM, Brian Utterback wrote:
> Just as a point of interest, one of the most heated debates I have ever
> been involved in internally here at Oracle was concerning whether
> getaddrinfo (as defined by POSIX) should or should not return IPv6
> addresses if the system only has IPv4 interfaces and/or only the
> loopback IPv6 address. The getaddrinfo call was designed to work
> efficiently on both dual stack and single stack systems, but the wording
> in the standard is slightly ambiguous especially considering the case
> that the host you are looking up might actually belong to the system you
> are on.
> On 11/18/13 16:01, Danny Mayer wrote:
>> On 11/18/2013 2:44 PM, A C wrote:
>>> On 11/18/2013 11:18, Majdi S. Abbas wrote:
>>>>     The fact that it's even trying means you didn't start ntpd with
>>>> -4, and the host has at least one IPv6 interface (this might be as
>>>> simple as v6 enabled on the loopback.)
>>>>     So, either ensure that v6 is fully disabled on the host, or add
>>>> -4 to your ntpd startup parameters.
>>> lo0 did indeed have a v6 address configured (hadn't noticed) though my
>>> eth0 does not.  I would not have expected ntpd to use v6 if any one
>>> interface did not have it.  Up until this point it never returned a v6
>>> address on lookup so that's probably why I never noticed that v6 had
>>> been enabled again (recent upgrade of OS).  I've disabled all v6 now and
>>> added -4 for good measure.
>> ntpd will use whatever addresses it gets back from DNS. If you don't
>> specify that you only want IPv4 addresses and it gets an IPv6 address it
>> will attempt to use it. This is a DNS and configuration issue not an ntp
>> issue. This is true of all applications (whether client or server) these
>> days.
>> Danny
>> _______________________________________________
>> questions mailing list
>> questions at lists.ntp.org
>> http://lists.ntp.org/listinfo/questions

More information about the questions mailing list