{"id":1193,"date":"2018-12-27T17:33:47","date_gmt":"2018-12-27T12:03:47","guid":{"rendered":"https:\/\/www.coimbatorewebhosting.com\/blog\/?p=1193"},"modified":"2021-07-22T16:36:28","modified_gmt":"2021-07-22T11:06:28","slug":"config-time-and-date-on-centos-7","status":"publish","type":"post","link":"https:\/\/coimbatorewebhosting.com\/blog\/config-time-and-date-on-centos-7\/","title":{"rendered":"How to config Time and date on CentOS 7 (NTP)"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/coimbatorewebhosting.com\/blog\/config-time-and-date-on-centos-7\/#How_to_config_Time_and_date_on_CentOS_7_NTP\" >How to config Time and date on CentOS 7 (NTP)<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/coimbatorewebhosting.com\/blog\/config-time-and-date-on-centos-7\/#Install_and_configure_NTP_Daemon\" >Install and configure NTP Daemon<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"How_to_config_Time_and_date_on_CentOS_7_NTP\"><\/span><span style=\"text-decoration: underline;\">How to config Time and date on CentOS 7 (NTP)<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/12\/ntp.jpg\" alt=\"time and date\" class=\"aligncenter size-full wp-image-1205\" width=\"829\" height=\"476\" srcset=\"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/12\/ntp.jpg 829w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/12\/ntp-300x172.jpg 300w, https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/12\/ntp-768x441.jpg 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/p>\n<p>The Network Time Protocol (<b>NTP<\/b>) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks.<\/p>\n<p><b>NTP<\/b>\u00a0time servers work within the\u00a0<b>TCP<\/b>\/IP suite and rely on User Datagram Protocol (<b>UDP<\/b>) port 123.<\/p>\n<p><b>NTP<\/b>\u00a0servers are normally dedicated\u00a0<b>NTP<\/b>\u00a0devices that use a single time reference to which they can synchronize a network. &#8230; Dedicated\u00a0<b>NTP<\/b>\u00a0servers are required for Security, Protection, Accuracy, Legality, and Control.<\/p>\n<p>NTP (Network Time Protocol) is a protocol which runs over port 123 UDP.\u00a0NTP synchronize clients time and date with a master server.<\/p>\n<p>Here in this tutorial the client side configuration is taken in to account where the server side configurations are not entirely different.<\/p>\n<p>Here let us assume that you have\u00a0root permission, otherwise, you may start commands with \u201csudo\u201d.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Install_and_configure_NTP_Daemon\"><\/span>Install and configure NTP Daemon<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>NTP package is provided by default from RHEL repositories, and can be installed by the following command:<\/p>\n<pre>yum install ntp<\/pre>\n<p>To make sure that the appropriate time zone is configured on the server please execute below command.<\/p>\n<pre>timedatectl<\/pre>\n<p>If you wish to change the timezone please follow following steps.<\/p>\n<p>to get the list of all the available time zones:<\/p>\n<pre>timedatectl list-timezones<\/pre>\n<p>To set your time zone you can use command below: (e.g. Kolkata)<\/p>\n<pre>timedatectl set-timezone Asia\/Kolkata<\/pre>\n<p>Now you need to active the NTPD service at boot:<\/p>\n<pre>systemctl enable ntpd\r\nsystemctl start ntpd<\/pre>\n<p>To get a basic report you can use<\/p>\n<pre>ntpstat<\/pre>\n<p>Or<\/p>\n<pre>date<\/pre>\n<p>And to get some information about the time synchronization process<\/p>\n<pre>ntpq -p<\/pre>\n<p>All of your NTP configurations are here:<\/p>\n<pre>\/etc\/ntp.conf<\/pre>\n<p>Please share you valuable comments to improve us better.<\/p>\n<p>To flush the DNS Cache in <a href=\"https:\/\/www.squarebrothers.com\/windows-web-hosting-india\/\" rel=\"nofollow noopener\" target=\"_blank\">Windows<\/a> and <a href=\"https:\/\/www.coimbatorewebhosting.com\/unlimited-coimbatore-web-hosting\/\">Linux<\/a>, <a href=\"https:\/\/www.coimbatorewebhosting.com\/blog\/flush-dns-cache-windows-linux\/\">click here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to config Time and date on CentOS 7 (NTP) The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. NTP\u00a0time servers work within the\u00a0TCP\/IP suite and rely on User Datagram Protocol (UDP) port 123. NTP\u00a0servers are normally dedicated\u00a0NTP\u00a0devices that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1205,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[153],"tags":[140,141,139,142],"class_list":["post-1193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-7-rhel-7","tag-ntp","tag-tcp","tag-time-and-date","tag-udp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/coimbatorewebhosting.com\/blog\/wp-content\/uploads\/2018\/12\/ntp.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pa2YU7-jf","_links":{"self":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/1193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=1193"}],"version-history":[{"count":0,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/1193\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/media\/1205"}],"wp:attachment":[{"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=1193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=1193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coimbatorewebhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}