How to join your linux server to the NTP pool project
This tutorial explains how to configure a NTP (Network Time Protocol) server (using ntpd) and join it to the continuously more demanded NTP pool project.
The NTP pool project is a DNS system, that balances the load of millions of queries for time synchronization by many electronic devices, such as servers, personal computers, tablets, smartphones and more. This means, that all queries for serving an accurate real time clock synchronization, are divided between all servers of the pool.
There are many factors, that increase the time deviation of any real clock. Listing the most relevant: acceleration and gravity (including gravitational waves). If a clock depends on a physical device, such as a quartz oscilator also temperature variations matter.
The NTP protocol is useful for the constantly synchronization of real time clocks, so that the inaccuracy of the real time clock of every day more used electronic devices, is decreased efficiently.
Without the NTP protocol, many electronic processes that depend on having access to an accurate real time clock, would be infeasible.
Some of those important processes are: encryption, bank transfers, digital signage and more.
Because time synchronization services are simple and important for our digital civilization, this tutorial invites you to setup your servers for joining the NTP pool project, so that you contribute to keep millions of digital transactions working properly.
1 Install the Network Time Protocol daemon
This package should have the same name in all linux distributions.
#Arch based systems pacman -S ntp#Debian based systems apt-get install ntp#Red Hat based systems dnf install ntp#Red Hat based systems yum install ntp#SUSE based systems zypper install ntp
dig 1a.ncomputers.org ANY
;; ANSWER SECTION:
1a.ncomputers.org. 26652 IN AAAA 2a02:c207:2010:9464::1
1a.ncomputers.org. 26652 IN A 188.8.131.52
2.3 Edit /etc/ntpd.conf file
Once you know the IPv6 and IPv4 addresses of the servers you chose, then copy and paste the below content to /etc/ntpd.conf replacing the bolded addresses accordingly.
restrict default kod nomodify nopeer noquery notrap
2.4 Restart the Network Time Protocol daemon
Once ntpd was configured, it is moment to load the new configuration file.
#init.d based init system service ntp restart#systemd as init system systemctl restart ntp
2.5 Test your server
You have to wait around five minutes until ntpd stabilizes the time sources and make sure port UDP 123 is open: NTP Server Online Tester.
3 Add web service redirect (optional)
In case your new NTP server is running web services as well, you may want to redirect web queries to the correct site. For example in apache you should add this virtual host:
Write the hostname of your new NTP server or one of its IPv4 / IPv6 static addresses.
Click on the submit button.
Hopefully you can provide at least one IPv4 static address and one IPv6 static address for each server.
Sometimes you have to wait few minutes until ntpd stabilizes the real time clock.
In case it asks for the physical location of your NTP server you only have to provide the country where it is located.
Once it appears in Your Servers list, you might want to handle the amount of traffic it serves, defining their net speed.
For OpenVZ virtual servers it is recommended, that you choose around 10MBit, since the server might be shutdown, because each OpenVZ instance usually supports a low amount of simultaneously network connections.
For physical and KVM servers you may select the highest available connection speed, even if your connection speed is lower than it.
As a reference data: the amount of traffic served by our NTP servers with a chosen net speed of 1000MBit is around 40 Kb/s downstream and 40 Kb/s upstream.