{"id":349,"date":"2018-03-23T00:00:11","date_gmt":"2018-03-23T00:00:11","guid":{"rendered":"http:\/\/linuxresellerwebhosting.in\/blog\/?p=349"},"modified":"2018-03-21T23:09:45","modified_gmt":"2018-03-21T23:09:45","slug":"join-your-server-to-ntp-pool-project-easily","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/join-your-server-to-ntp-pool-project-easily\/","title":{"rendered":"Join your server to NTP pool project easily"},"content":{"rendered":"<p>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.<\/p>\n<p>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.<\/p>\n<p>Without the NTP protocol, many electronic processes that depend on having access to an accurate real time clock, would be infeasible.<\/p>\n<p>Some of those important processes are: encryption, bank transfers, digital signage and more.<\/p>\n<p>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.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Install_the_Network_Time_Protocol_daemon\"><\/span><em><strong>Install the Network Time Protocol daemon<\/strong><\/em><span class=\"ez-toc-section-end\"><\/span><\/h3><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/join-your-server-to-ntp-pool-project-easily\/#Install_the_Network_Time_Protocol_daemon\" >Install the Network Time Protocol daemon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/join-your-server-to-ntp-pool-project-easily\/#Configure_the_Network_Time_Protocol_daemon\" >Configure the Network Time Protocol daemon<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/join-your-server-to-ntp-pool-project-easily\/#Add_web_service_redirect_optional\" >Add web service redirect (optional)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/join-your-server-to-ntp-pool-project-easily\/#Join_the_NTP_pool_project\" >Join the NTP pool project<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>This package should have the same name in all linux distributions.<\/p>\n<p><strong>Arch based systems<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">pacman -S ntp<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Debian based systems<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">apt-get install ntp<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Red Hat based systems<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">dnf install ntp<\/pre>\n<pre class=\"lang:default decode:true \">yum install ntp<\/pre>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Configure_the_Network_Time_Protocol_daemon\"><\/span><em><strong>Configure the Network Time Protocol daemon<\/strong><\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Before you decide to join your servers to the NTP pool project, please read this carefully: www.pool.ntp.org\/join.html<\/p>\n<p>If you agree with the text provided in the last link, then it is moment to choose at least three NTP servers your servers will synchronize with.<\/p>\n<p>Please consider that the closer the servers are, the more accurate the time of your servers should be.<\/p>\n<p>It is also recommended to choose servers located in opposite directions, as a strategy against failures of the same fiber optic or copper cables that provide linkage between the servers.<\/p>\n<p><strong>Choose static NTP servers<\/strong><\/p>\n<p>You may use these stratum 2 NTP servers:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">1a.ncomputers.org\r\n1b.ncomputers.org\r\n1c.ncomputers.org<\/pre>\n<p>You may pick servers of the pool randomly:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">0.pool.ntp.org\r\n1.pool.ntp.org\r\n2.pool.ntp.org\r\n3.pool.ntp.org<\/pre>\n<p>You may replace de with your country code<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">1.de.pool.ntp.org\r\n1.de.pool.ntp.org\r\n2.de.pool.ntp.org\r\n3.de.pool.ntp.org<\/pre>\n<p>You may search for additional servers here:<\/p>\n<p><a href=\"http:\/\/support.ntp.org\/bin\/view\/Servers\/StratumTwoTimeServers\" target=\"_blank\" rel=\"noopener\">support.ntp.org\/bin\/view\/Servers\/StratumTwoTimeServers<\/a><\/p>\n<p><a href=\"http:\/\/support.ntp.org\/bin\/view\/Servers\/StratumOneTimeServers\" target=\"_blank\" rel=\"noopener\">support.ntp.org\/bin\/view\/Servers\/StratumOneTimeServers<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>Query for AAAA and A records<\/strong><\/em><\/p>\n<p>Once you know which servers you want to use, it is moment to know their public IP address. It is preferably that they have IPv6 connectivity.<\/p>\n<p>You may use the linux command dig:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">dig 1a.ncomputers.org ANY<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">;; ANSWER SECTION:\r\n1a.ncomputers.org. 26652 IN AAAA 2a02:c207:2010:9464::1\r\n1a.ncomputers.org. 26652 IN A 173.212.196.208<\/pre>\n<p>Or this online app toolbox.googleapps.com\/apps\/dig<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">;ANSWER\r\n1a.ncomputers.org. 86399 IN AAAA 2a02:c207:2010:9464::1\r\n1a.ncomputers.org. 86399 IN A 173.212.196.208<\/pre>\n<p>&nbsp;<\/p>\n<p><em><strong>Edit \/etc\/ntpd.conf file<\/strong><\/em><\/p>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">driftfile \/var\/lib\/ntp\/ntp.drift\r\nrestrict default kod nomodify nopeer noquery notrap\r\nrestrict localhost\r\nserver 2001:4ca0:0:103::81bb:fe20\r\nserver 2001:638:a000:1123:123::1\r\nserver 2001:62a:4:311::123<\/pre>\n<p><em><strong>Restart the Network Time Protocol daemon<\/strong><\/em><\/p>\n<p>Once ntpd was configured, it is moment to load the new configuration file.<\/p>\n<p><strong>init.d based init system (e.g: upstart, sysvinit)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">service ntp restart<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>systemd as init system<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">systemctl restart ntp<\/pre>\n<p>&nbsp;<\/p>\n<p><em><strong>Test your server<\/strong><\/em><\/p>\n<p>You have to wait around five minutes until ntpd stabilizes the time sources and make sure port UDP 123 is open: NTP server test.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Add_web_service_redirect_optional\"><\/span>Add web service redirect (optional)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>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:<\/p>\n<p><strong>Using mod_alias<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">&lt;VirtualHost *:80&gt;\r\nServerName pool.ntp.org\r\nServerAlias *.pool.ntp.org *.ntppool.org\r\nRedirect permanent \/ http:\/\/www.pool.ntp.org\/\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p><strong>Using mod_rewrite<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">&lt;VirtualHost *:80&gt;\r\nServerName pool.ntp.org\r\nServerAlias *.pool.ntp.org *.ntppool.org\r\nRewriteRule ^ http:\/\/www.pool.ntp.org%{REQUEST_URI} [R=301,L]\r\n&lt;\/VirtualHost&gt;<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Join_the_NTP_pool_project\"><\/span>\nJoin the NTP pool project<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Finally, in order to join your servers to the NTP pool project, just follow these steps:<\/p>\n<blockquote><p>&gt;Go to manage.ntppool.org\/manage<br \/>\n&gt;Sign up (in case you do not have an account).<br \/>\n&gt;Log in.<br \/>\n&gt;Write the hostname of your new NTP server or one of its IPv4 \/ IPv6 static addresses.<br \/>\n&gt;Click on the submit button.<\/p><\/blockquote>\n<p>Hopefully you can provide at least one IPv4 static address and one IPv6 static address for each server.<\/p>\n<p>Sometimes you have to wait few minutes until ntpd stabilizes the real time clock.<\/p>\n<p>In case it asks for the physical location of your NTP server you only have to provide the country where it is located.<\/p>\n<p>Once it appears in Your Servers list, you might want to handle the amount of traffic it serves, defining their net speed.<\/p>\n<p>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.<\/p>\n<p>For physical and KVM servers you may select the highest available connection speed, even if your connection speed is lower than it.<\/p>\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are many factors, that increase the time deviation of any real clock. Listing the most relevant: acceleration and gravity<\/p>\n","protected":false},"author":1,"featured_media":350,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[4],"tags":[11,12,13,14],"class_list":["post-349","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps","tag-linux","tag-ntp","tag-os","tag-time-servers"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":1,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions\/351"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/350"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}