Product SiteDocumentation Site

2.2.2. Configuring the Network Time Protocol

As opposed to the manual setup described above, you can also synchronize the system clock with a remote server over the Network Time Protocol (NTP). For the one-time synchronization only, use the ntpdate command:
  1. Check whether the selected NTP server is accessible by using the ntpdate command in the following form:
    ntpdate -q server_address
    For example, to connect to, type:
    ~]# ntpdate -q
    server, stratum 2, offset -39.275438, delay 0.16083
    server, stratum 2, offset -39.269122, delay 0.17191
    server, stratum 2, offset -39.270239, delay 0.20482
    23 May 01:05:54 ntpdate[10619]: step time server offset -39.275438 sec
  2. When you find a satisfactory server, run the ntpdate command followed with one or more server addresses:
    ntpdate server_address...
    For instance:
    ~]# ntpdate
    23 May 01:07:13 ntpdate[10669]: step time server offset -39.275436 sec
    Unless an error message is displayed, the system time should now be set. You can check the current by setting typing date without any additional arguments as shown in Section 2.2.1, “Configuring the Date and Time”.
  3. In most cases, these steps are sufficient. Only if you really need one or more system services to always use the correct time, enable running the ntpdate at boot time:
    systemctl enable ntpdate.service
    For more information about system services and their setup, refer to Chapter 7, Services and Daemons.


    If the synchronization with the time server at boot time keeps failing, that is, you find a relevant error message in the /var/log/boot.log system log, try to add the following line to /etc/sysconfig/network:
However, the more convenient way is to set the ntpd daemon to synchronize the time at boot time automatically:
  1. Open the NTP configuration file /etc/ntp.conf in a text editor, creating a new one if it does not already exist.
  2. Add or edit the list of public NTP servers. If you are using Fedora 15, the file should already contain the following lines, but feel free to change or expand these according to your needs:
    server iburst
    server iburst
    server iburst

    Speeding up initial synchronization

    To speed the initial synchronization up, it is recommended that the iburst directive is added at the end of each server line.
  3. In the same file, set the proper permissions, giving the unrestricted access to localhost only:
    restrict default kod nomodify notrap nopeer noquery
    restrict -6 default kod nomodify notrap nopeer noquery
    restrict -6 ::1
  4. Save the changes, exit the editor, and restart the NTP daemon:
    systemctl restart ntpd.service
  5. Additionally, make sure that ntpd daemon is started at boot time:
    systemctl enable ntpd.service