[ntp:questions] Re: Suppressing IP6; Keeping /dev/ppsX; simple MSF clocks and monitors

Danny Mayer mayer at gis.net
Wed Nov 26 22:35:05 UTC 2003


John Hay <jhay at dolphin.icomtek.csir.co.za> wrote in message news:<3fc43e99$0$64720 at hades.is.co.za>...
> : >> But when I actually came to have to restart ntpd the
> : >> host was resolved to an IP6 address and ntpd started complaining that
> : >> there was no route to host. The only way I've managed to start ntpd and
> : >> include this host is to specify it by IP4 IP address in ntp.conf
> : > 
> : > Hmmm.  What happens when there is both an IPv4 address for a host name
> : > and an IPv6 address?
> : > 
>  
> : My experience is that 4.2.0 will choose the IPv6 address over the IPv4 
> : address.
> 
> That actually depends on your OS. Ntpd just does a dns lookup using
> getaddrinfo() and use the first address returned.
> 
> John

I haven't looked at the source code for getaddrinfo, but my experience has
been that, if they exist, it will always return the IPv6 addresses first and
then the IPv4 addresses (technically AAAA records and then A records).

Danny



More information about the questions mailing list