I am trying to synchronize my clock with a NTP server by following the instructions here http://support.ntp.org/bin/view/Support/GettingStarted , but this does not work.
I am on Mac OS X El Capitan 10.11.2, and here is what I do. I picked server ntp.your.org ( http://support.ntp.org/bin/view/Servers/PublicTimeServer000498 ) and I synchronize my computer with it:
XXX-macbook-pro-2:ntp-4.2.8p6 XXX$ sudo ntpdate -b ntp.your.org
31 Mar 20:05:04 ntpdate[43114]: step time server 204.9.54.119 offset -0.005629 sec
Then to check that it works, I do
XXX-macbook-pro-2:ntp-4.2.8p6 XXX$ ntpdc -c peers
nodename nor servname provided, or not known
Also, if I do ntpq I get
XXX-macbook-pro-2:ntp-4.2.8p6 XXX$ ntpq -pcrv
nodename nor servname provided, or not known
while if I do the same by switching my internet connection to a different WIFI network, I get a different output:
XXX-macbook-pro-2:XXX XXX$ ntpq -pcrv
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp.your.org .INIT. 16 u - 64 0 0.000 0.000 0.000
associd=0 status=c012 leap_alarm, sync_unspec, 1 event, freq_set,
version="ntpd 4.2.6@1.2089-o Fri May 28 01:20:53 UTC 2010 (1)",
processor="x86_64", system="Darwin/15.2.0", leap=11, stratum=16,
precision=-20, rootdelay=0.000, rootdisp=0.075, refid=INIT,
reftime=00000000.00000000 Mon, Jan 1 1900 0:09:21.000,
clock=daa9468e.835891f4 Fri, Apr 1 2016 21:12:14.513, peer=0, tc=3,
mintc=3, offset=0.000, frequency=-47.221, sys_jitter=0.000,
clk_jitter=0.001, clk_wander=0.000
Do you have any idea of what is the issue at the bottom of this?
Thank you.
From the output you provided when you changed networks leads me to believe this is a network issue.
The original problem you posted is referenced in this post and another here. They both point towards an IP config issue - either DNS or DHCP.
It looks like port 123/UDP might be blocked either on the host machine or the network router/gateway/firewall. You need to check this, or connect to a network where you know no ports are blocked. Wired or wifi shouldn't matter unless you have different IP Config or security settings.
The fact that once you changed networks you see
reach = 0
&refif = .INIT.
says that you can resolve the ntp server (ntp.your.org) but you can't connect to it.From a working setup you would expect to see something like this below (Taken from one of my answers on SuperUser - addresses removed)
It's worth pointing out that ntp is most happy with a minimum of 3 servers and ideally 5 for it to work correctly, and pick the 'best' timing source accordingly.
The docs here will help with what some of the other fields relate too.
I'm also thinking this question should be migrated to SuperUser as its not a programming related question.