Setting Up “NTP (Network Time Protocol) Server” in RHEL/CentOS 7

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

17 Responses

  1. labanda says:

    While trying to configure ntp server, i came across this issue. The user/group should be ntp/ntp.
    You need the add the following steps if you come across this error “No association ID’s returned”:
    chown ntp:ntp /etc/ntp.conf
    chmod 0640 /etc/ntp.conf
    systemctl stop ntpd
    systemctl start ntpd
    systemctl status ntpd

  2. Chetra says:

    I am configure ntp server on centos 7 and i want to sync it on windows 10 but when i update it can’t syn from ntp server. it show message : An error occurred while windows was synchronising with x.x.x.x.

    • Matei Cezar says:

      You have the same issue with other nodes trying to sync time with centos ntp server? verify if ntp port is open on server (123 tcp and udp).

  3. Shantanu says:

    I have configured ntp server on centos 6.7 and entered public ntp server address ” in.pool.ntp.org”. when i run command “ntpq -np” or “ntpstat” then its showing its syncing the time from public ntp server but in actual its not syncing the time automatically. when i set wrong time in my ntp server and wait for some time then it doesn’t correct my system time, Now if i run “ntpq -np, it says it is syncing time from local clock. In this condition i have to restart ntp service, then again it shows time syncing from public ntp server and correct the time also. But its not done automatically.
    We are using clients on windows os here. i have done the necessary settings in internet time tab (Given our ntp server ip) and in registery also but those are also not syncing automatically but if i click on update now button then it corrects the time.

    Please suggest on this.

    • Matei Cezar says:

      Add a cronjob to sync time, for instance every hour, using the ntpdate command: sudo ntpdate -s in.pool.ntp.org.

  4. penguin says:

    One slight correction:

    In step 8, the line
    # sytemctl status ntp
    should read:
    # sytemctl status ntpd

  5. Good -ish! In section 3 you say “open NTP daemon main configuration file” but give no clue as to where it is!

  6. Denis says:

    Excellent manual, thank you!

    One subtle note – you have misspelled in p. 7 (incorrect typographic dash). It should be:
    firewall-cmd –add-service=ntp –permanent

  7. Deepanjan says:

    how to bypass it through squid proxy

  8. Joseph Liu says:

    Do you find that ntpdate -q is much slower under RHEL 7 versus RHEL 6?

    This is what we found running ntpdate. It takes almost 7 seconds to get results back. In RHEL 6, it is quicker.

    $ time ntpdate -q 0.ro.pool.ntp.org
    server 194.102.255.19, stratum 2, offset -0.004015, delay 0.23289
    server 89.36.93.9, stratum 2, offset 0.009549, delay 0.20610
    server 85.204.240.2, stratum 2, offset -0.004843, delay 0.21089
    server 91.216.151.202, stratum 2, offset -0.009425, delay 0.21852
    29 Oct 11:22:26 ntpdate[22202]: adjust time server 85.204.240.2 offset -0.004843 sec

    real 0m6.913s
    user 0m0.002s
    sys 0m0.006s

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's