How do I configure network time protocol (NTP) for servers?

Accurate time synchronization across your infrastructure depends on proper NTP configuration. Here’s how to set it up on Windows, Linux, and Kubernetes nodes.


Windows Servers

  1. Open Command Prompt as Administrator: search for cmd, right-click, and select “Run as Administrator.”
  2. Configure the NTP server:
    w32tm /config /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org" /syncfromflags:manual /reliable:YES /update
    Replace 0.pool.ntp.org and 1.pool.ntp.org with your preferred NTP servers.
  3. Restart the Windows Time service:
    net stop w32time
    net start w32time
  4. Verify synchronization:
    w32tm /query /status
    w32tm /query /peers

Linux Servers

Using the NTP daemon (ntpd)

  1. Install the NTP package if it’s not already present:
    RHEL/CentOS: sudo yum install ntp
    Ubuntu: sudo apt update && sudo apt install ntp
  2. Edit /etc/ntp.conf and add or modify your server lines:
    server 0.pool.ntp.org iburst
    server 1.pool.ntp.org iburst
    server 2.pool.ntp.org iburst
    server 3.pool.ntp.org iburst

    Replace the pool addresses with your preferred NTP servers.
  3. Start and enable the service:
    RHEL/CentOS: sudo systemctl start ntpd && sudo systemctl enable ntpd
    Ubuntu: sudo systemctl start ntp && sudo systemctl enable ntp
  4. Check synchronization status:
    ntpq -p
    timedatectl status

Using Chrony (common on newer distributions)

Modern releases such as CentOS 8, RHEL 8, and Ubuntu 20.04+ use Chrony by default.

  1. Install Chrony:
    RHEL/CentOS: sudo yum install chrony
    Ubuntu: sudo apt install chrony
  2. Edit /etc/chrony/chrony.conf and add your NTP servers:
    server 0.pool.ntp.org iburst
    server 1.pool.ntp.org iburst
    server 2.pool.ntp.org iburst
    server 3.pool.ntp.org iburst
  3. Restart the service:
    sudo systemctl restart chronyd
  4. Verify sources:
    chronyc sources

Kubernetes Nodes

Time must be synchronized across all master and worker nodes.

  1. Install and configure NTP or Chrony on every node (follow the Linux instructions above). Use identical server lists on all nodes.
  2. Confirm synchronization on each node:
    timedatectl status

Best Practices

  • Pick reliable sources. Use public pools (e.g., pool.ntp.org) or internal servers from your ISP or datacenter.
  • Configure multiple servers. At least three upstream sources provide failover if one becomes unreachable.
  • Open UDP port 123. Ensure your firewall allows NTP traffic.
  • Monitor regularly. Check for drift, especially on virtualized hosts where time skew is common.
  • Centralize in large environments. Run a dedicated NTP server that syncs to external sources and distributes time to internal clients.

Liked this briefing? Get it in your inbox

Every morning: the stories that make tech leaders act, with official clips and primary sources. Free, 5-minute read.

Free. One click to unsubscribe. We never share your email. Privacy

How do I configure network time protocol (NTP) for servers?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top