My clock is off, so I would like to synchronize it using ntpdate
. I tried several different NTP servers, but for some reason I always get the following error message:
$ sudo ntpdate ntp.ubuntu.com
4 Mar 12:27:35 ntpdate[1258]: no server suitable for synchronization found
$ sudo ntpdate pool.ntp.org
4 Mar 12:27:50 ntpdate[1267]: no server suitable for synchronization found
$ sudo ntpdate de.pool.ntp.org
4 Mar 12:28:01 ntpdate[1273]: no server suitable for synchronization found
$ sudo ntpdate us.pool.ntp.org
4 Mar 12:28:12 ntpdate[1276]: no server suitable for synchronization found
Related questions
I have looked through related questions, but none solve my problem:
- Unable to synchronize time using NTP - this guy gets a different error than I; his problem was a conflict with the
ntpd
daemon. I do not have thentp
package (which includes thentpd
daemon) installed at all. - How to force a clock update using ntp? - this guy's problem is that the
ntpdate
command wouldn't properly work at boot time when he put it into his/etc/rc.local
, and the problem was similarly a conflict with thentpd
daemon that was running. Neither am I trying to runntpdate
at boot time, nor (again) do I have thentpd
daemon installed. - Unable to sync time using `ntpdate`, error: "no server suitable for synchronization found" - this is my error alright, but the accepted answer is basically "Use
ntpd
instead ofntpdate
". Aaarggh...
Things I have tried
I installed the ntp package
...and tried using the ntpd
daemon instead of the ntpdate
utility. It won't sync my time either; the daemon starts fine, but my clock remains off. I even tried using the exact /etc/ntp.conf
from the accepted answer in the latter post, and restarting the daemon. No go. Anyway, I don't want to use the daemon. I am perfectly aware that ntpdate
is considered "deprecated", and it is advised to use ntpd -q
instead. Also see here:
But since ntpd
doesn't work for me either, the problem lies elsewhere. And I find that I would prefer not having to install any extra packages just for synchronizing the clock. ntpdate
comes pre-installed with Ubuntu, and it should work just fine. So I uninstalled the ntp
package again.
Maybe port 123 is blocked?
From this post:
...I got the idea that port 123 may be blocked from my computer / network at my work place. Indeed,
$ sudo nmap -p123 -sU -P0 localhost
...
PORT STATE SERVICE
123/udp closed ntp
...
$ sudo ufw allow 123/udp
Rules updated
Rules updated (v6)
$ sudo nmap -p123 -sU -P0 localhost
...
PORT STATE SERVICE
123/udp open ntp
...
But still:
$ sudo ntpdate ntp.ubuntu.com
4 Mar 13:06:16 ntpdate[4361]: no server suitable for synchronization found
Even with the -u
option, which tells ntpdate
to use an unprivileged port for syncing (instead of port 123
) which is certainly not blocked from my work place:
$ sudo ntpdate -u ntp.ubuntu.com
4 Mar 13:06:28 ntpdate[4427]: no server suitable for synchronization found
Maybe the strata are too high?
Lastly, from this post over at serverfault:
...I thought that maybe the strata from the NTP servers are too high. They aren't, though. Let's see a little more debugging info:
$ sudo ntpdate -dv ntp.ubuntu.com
4 Mar 13:12:24 ntpdate[4523]: ntpdate [email protected] Wed Oct 9 19:08:07 UTC 2013 (1)
Looking for host ntp.ubuntu.com and service ntp
host found : golem.canonical.com
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
transmit(91.189.89.199)
transmit(91.189.94.4)
91.189.89.199: Server dropped: no data
91.189.94.4: Server dropped: no data
server 91.189.89.199, port 123
stratum 0, precision 0, leap 00, trust 000
refid [91.189.89.199], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
originate timestamp: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
transmit timestamp: d6c041ae.e6166441 Tue, Mar 4 2014 13:12:30.898
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000
server 91.189.94.4, port 123
stratum 0, precision 0, leap 00, trust 000
refid [91.189.94.4], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
originate timestamp: 00000000.00000000 Mon, Jan 1 1900 1:00:00.000
transmit timestamp: d6c041af.1948fc50 Tue, Mar 4 2014 13:12:31.098
filter delay: 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000
4 Mar 13:12:33 ntpdate[4523]: no server suitable for synchronization found
Pfeeewww... this was a long one, sorry for that. I'm stumped. Any clues?
Update: additional infos
No matter whether an NTP server HOSTNAME
figures in /etc/ntp.conf
, and no matter whether the ntpd
service is running or not, whenever I run sudo ntpdate -u HOSTNAME
, I get no server suitable for synchronization found
. Same thing when the ntpd
service is not running and I omit the -u
option. When the ntpd
service is running and I omit the -u
option, I instead get the NTP socket is in use, exiting
.
Also:
$ timedatectl status
Local time: Wed 2014-03-05 13:11:54 CET
Universal time: Wed 2014-03-05 12:11:54 UTC
Timezone: Europe/Berlin (CET, +0100)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2013-10-27 02:59:59 CEST
Sun 2013-10-27 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2014-03-30 01:59:59 CET
Sun 2014-03-30 03:00:00 CEST
But the UTC time is not correct here. Right now UTC time is 11:11
, not 12:11
.
And:
$ sudo hwclock --show
Wed 05 Mar 2014 01:11:56 PM CET -0.625627 seconds
Your hosting provider is blocking ntp packets. This heavy handed approach has been implemented by some ISPs in response to the DDoS attacks. You can see that ntpdate is sending the packets fron the ntpdate -vd :
I would contact your ISP and ask if they are blocking external ntp requests and if they have a local server that you can use for time sync.
There are a couple more obscure possibilities but it is tough to rule them out since you have not posted any logs from syslog.
This is not an ntp answer, however...
this and the curl version here.
Use htpdate
If ntp transmission is blocked in your network, install htpdate. It syncs time over http protocol. Accuracy will be withing 0.5 secs, according to man page.
htpdate service will start when you install the package. Time will be update immediately if there is internet connection.
I had the same issue and this is how I solved it. I have give a detailed answer from top to bottom. You might want to skip to middle of my answer or just refer the screenshots below for understanding it in a glance.
First install ntpdate(Obviously you have done this)
NEXT You need to configure ntp with servers as follows:
You should at least set following parameter in /etc/ntp.conf config file:
server
For example, open /etc/ntp.conf file using nano text editor:
Locate server parameter and if it is empty set it as follows:
But usually In ubuntu already some servers are prewritten which might be
Then Save the file and restart the ntpd service:
You can synchronize the system clock to an NTP server immediately with following command:
or just run already servers are defined
or other servers that are defined using server
generally
BUT after that there is a chance you get the Error
NTP socket in use
as shown below:In that case just run
to update when ntp deamon is running
OR just stop the deamon,update and start it again as follows:
and you will get
Similar to Alex's answer, this worked for me for getting around the ntp port being firewalled: