the command ntpdate -q -4 localhost in an NTP server is making two queries to and one of them fails:

is this failing because of the /etc/hosts file?

ntpdate -q -4 localhost
server, stratum 2, offset 0.000006, delay 0.02565
server, stratum 0, offset 0.000000, delay 0.00000

/etc/hosts file content:

::1             1a.ncomputers.org 1a localhost       1a.ncomputers.org 1a localhost
2a02:c207:2010:6775::1  1b.ncomputers.org 1b
2a02:c205:2009:8290::1  1c.ncomputers.org 1c    1b.ncomputers.org 1b  1c.ncomputers.org 1c

/etc/ntpd.conf file content:

driftfile /var/lib/ntp/ntp.drift
restrict default kod nomodify nopeer noquery notrap
restrict localhost
server 2001:4ca0:0:103::81bb:fe20
server 2001:638:a000:1123:123::1
server 2001:62a:4:311::123

ntpdate version: 4.2.8p10

  • Don't think you need to specify "-4" and I suspect a restriction is in place. Can we see your ntp.conf file? Oct 3 '17 at 22:27
  • Thanks so much for your answer. I am a little busy right now, so I will answer you using online content, so that it is easer, and then later answer you better. I am trying what you propose, but still not working, example here ntp.conf in chapter 2.3
    – ncomputers
    Oct 3 '17 at 23:23

You might need to add this to your ntp.conf file to allow localhost IPV4 and IPV6 queries:

restrict ::1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.