How does Ubuntu synchronize time without ntp?

This is done by synchronizing with ntpdate tool.

man ntpdate

NAME
       ntpdate - set the date and time via NTP

ntpdate sets the local date and time by polling the Network Time Proto‐
       col (NTP) server(s) given as the server arguments to determine the cor‐
       rect time. It must be run as root on the local host (unless the  option
       -q  is used). A number of samples are obtained from each of the servers
       specified and a subset of the NTP clock filter and selection algorithms
       are  applied  to  select  the best of these. Note that the accuracy and
       reliability of ntpdate depends on the number of servers, the number  of
       polls each time it is run and the interval between runs.

       ntpdate  can  be run manually as necessary to set the host clock, or it
       can be run from the host startup script to set the clock at boot  time.
       This is useful in some cases to set the clock initially before starting
       the NTP daemon ntpd. It is also possible to run  ntpdate  from  a  cron
       script.  However,  it  is important to note that ntpdate with contrived
       cron scripts is no substitute for the NTP daemon, which uses  sophisti‐
       cated  algorithms to maximize accuracy and reliability while minimizing
       resource use. Finally, since ntpdate does not discipline the host clock
       frequency as does ntpd, the accuracy using ntpdate is limited.

You can do so with

sudo ntpdate TIME-SERVER

TIME-SERVER lists can be founded here


Ubuntu synchronises with the ntpdate utility once each time the network connection comes up (which usually happens when you boot).

This utility is installed by default, but only runs when Ubuntu calls it and does not stay running in the background as a daemon.

Installing the ntp package installs the NTP daemon. The ntp daemon allows for the time to be continually synchronised while the system is running.


Update: in recent versions of Ubuntu (eg 16.04) ntpdate is replaced by timedatectl, which synchonises once on boot as well as when a network comes up, but does not keep running at other times. See https://help.ubuntu.com/lts/serverguide/NTP.html for more.


For those of you with 16.04 LTS time sync appears to be handled by sytemd specifically "timedatectl"

timedatectl status
Local time: Wed 2016-11-30 17:45:18 CST
Universal time: Wed 2016-11-30 23:45:18 UTC
RTC time: Sun 2016-12-04 06:50:39
Time zone: America/Chicago (CST, -0600)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no

Config is

/etc/systemd/timesyncd.conf

More info here: Time Synchronisation with NTP AND timedatectl

Tags:

Time

Ntp