[ntp:questions] NTP using server IPV6 address instead of IPV4

Potter, Timothy CCS Timothy.Potter at KiddeUS.com
Thu Mar 28 12:41:37 UTC 2019


I have a laptop running a version of Linux ( 3.12 ). I have ntpd installed and configured to sync with time.google.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__time.google.com_&d=DwMFAg&c=ilBQI1lupc9Y65XwNblLtw&r=wuJ3SCTwEkewcD5nPmQG4miH-KGwnlEAU83WIThJ8jo&m=NepU8rkWWZFJW4eU5iwlqpKP1UqBmM1FPjFwjjSxzIw&s=e8JX9WJi0A6L-reJb92zH1grUPooZYmdTMdG3QTm2Q0&e=>. The problem I am having is if I am plugged into a network that only provides an IPV4 address, ntp's dns is using the ipv6 address:

    root at Node00b01973d6cc:~# ntpq -pn

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

 127.127.1.0     .LOCL.          10 l    7   64    1    0.000    0.000   0.002

 ff0e::101       .MCST.          16 M    -   64    0    0.000    0.000   0.002

 2001:4860:4806: .INIT.          16 u    -   64    0    0.000    0.000   0.000
Now, if I force ntpd to use only ipv4 DNS with the -4 option, everything works fine

root at Node00b01973d6cc:~# ntpq -pn 172.16.17.111

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

 127.127.1.0     .LOCL.          10 l   60   64    1    0.000    0.000   0.002

 216.239.35.12   .GOOG.           1 u   57   64    1   29.278  341.883   0.002
But I don't want to do this because if I go to a network that only gives ipv6 addresses this will fail. Is there a way to configure ntp to only use ipv4 ( or ipv6 ) if my interface actually has an ip address in that family?
Thank you,

Tim




More information about the questions mailing list