{"id":1456,"date":"2011-08-21T21:52:29","date_gmt":"2011-08-21T20:52:29","guid":{"rendered":"http:\/\/www.haydnwilliams.com\/blog\/?p=1456"},"modified":"2022-04-11T21:34:01","modified_gmt":"2022-04-11T20:34:01","slug":"uhs-9-ntp-server","status":"publish","type":"post","link":"https:\/\/www.haydnwilliams.com\/blog\/uhs-9-ntp-server\/","title":{"rendered":"UHS9 &#8211; NTP Server"},"content":{"rendered":"<p>The official Ubuntu documentation has a good starter guide to Network Time Protocol (NTP) and implementing it <a title=\"Ubuntu Documentation - Time Synchronisation with NTP\" href=\"https:\/\/help.ubuntu.com\/12.10\/serverguide\/C\/NTP.html\" target=\"_blank\" rel=\"noopener\">here<\/a>. Essentially you need to install <strong>ntpd<\/strong> (NTP daemon), which will then update your system time on a regular basis from another source, <em>i.e.<\/em> something you believe to be more reliable than your computer. Your newly-accurate server can then broadcast this correct time to all other devices on your network. To install <strong>ntpd<\/strong>, just use <strong>apt-get<\/strong> again:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo apt-get install ntpd<\/pre>\n<p>Once it&#8217;s installed, you&#8217;ll need to choose a source machine from which <strong>ntpd<\/strong> will take it&#8217;s timings. The <a title=\"The NTP Project\" href=\"http:\/\/ntp.org\/\" target=\"_blank\" rel=\"noopener\">NTP Project<\/a> exists solely for this purpose, and has servers located around the globe which you can use.\u00a0 You can find the list of UK ntp.org pool servers at <a title=\"UK NTP Servers - ntp.org\" href=\"http:\/\/www.pool.ntp.org\/zone\/uk\" target=\"_blank\" rel=\"noopener\">http:\/\/www.pool.ntp.org\/zone\/uk<\/a>. Once you&#8217;ve selected the servers you want to use, edit <strong>\/etc\/ntp.conf<\/strong> to include the relevant host names. For the UK, this means your <strong>ntp.conf<\/strong> will look a bit like this:<\/p>\n<pre># Specify one or more NTP servers\r\nserver 0.uk.pool.ntp.org\r\nserver 1.uk.pool.ntp.org\r\nserver 2.uk.pool.ntp.org\r\nserver 3.uk.pool.ntp.org<\/pre>\n<p>NUbuntugeek.com has a <a title=\"Network Time Protocol on ubuntugeek.com\" href=\"http:\/\/www.ubuntugeek.com\/network-time-protocol-ntp-server-and-clients-setup-in-ubuntu.html\" target=\"_blank\" rel=\"noopener\">great page<\/a> which goes into more detail about restricting access to your NTP server and checking synchronisation using the <strong>-np<\/strong> switch for <strong>ntpd<\/strong>. I&#8217;d heartily recommend the latter, just to make sure that you are actually synchronising in a valid manner, rather than syncing all your clocks to the wrong time.<\/p>\n<p>Don&#8217;t forget that once you&#8217;ve done this, your machine is ready to start passing on the correct time to other boxes on your network, but you still need to tell all those boxes to look to your server for the time. On the Mac, I was able to just enter the IP of my server into the &#8220;Date and Time&#8221; control panel preferences pane, and everything worked perfectly. I haven&#8217;t got it working on the Windows box yet, but that&#8217;s less important!<\/p>\n<div id=\"attachment_1503\" style=\"width: 460px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1503\" class=\"size-full wp-image-1503\" title=\"Updating NTP server address in Mac OS X preferences\" src=\"http:\/\/www.haydnwilliams.com\/blog\/wp-content\/uploads\/2011\/06\/20110619c.jpg\" alt=\"Updating NTP server address in Mac OS X preferences\" width=\"450\" height=\"340\" srcset=\"https:\/\/www.haydnwilliams.com\/blog\/wp-content\/uploads\/2011\/06\/20110619c.jpg 450w, https:\/\/www.haydnwilliams.com\/blog\/wp-content\/uploads\/2011\/06\/20110619c-300x226.jpg 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><p id=\"caption-attachment-1503\" class=\"wp-caption-text\">Updating NTP server address in Mac OS X preferences<\/p><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The official Ubuntu documentation has a good starter guide to&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[656,605,613,612,655,614,615,657,604],"class_list":["post-1456","post","type-post","status-publish","format-standard","hentry","category-it","tag-clock","tag-home-server","tag-network-time-protocol","tag-ntp","tag-ntp-org","tag-ntpd","tag-ntpdate","tag-time","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts\/1456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/comments?post=1456"}],"version-history":[{"count":0,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/posts\/1456\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/media?parent=1456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/categories?post=1456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.haydnwilliams.com\/blog\/wp-json\/wp\/v2\/tags?post=1456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}