Operations 4 min read

Configure Offline NTP Time Sync on Ubuntu/Debian with systemd-timesyncd

This guide explains how to install and configure systemd-timesyncd for reliable NTP time synchronization on Ubuntu or Debian systems, especially in isolated environments, including selecting domestic NTP servers, restarting the service, and verifying synchronization status with timedatectl.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Configure Offline NTP Time Sync on Ubuntu/Debian with systemd-timesyncd

Ubuntu's default time synchronization server is ntp.ubuntu.com, while Debian uses 0.debian.pool.ntp.org; each Linux distribution provides its own official NTP servers. In China these servers may have high latency, but the impact on clock synchronization is minimal.

In environments without internet access, such as corporate intranets or cloud subnets, you must configure time synchronization yourself.

This article shows how to set up time synchronization without building your own NTP server.

Installation

systemd-timesyncd is usually pre‑installed. If it is missing, install it manually: sudo apt install systemd-timesyncd The package conflicts with the traditional ntp package, so only one can be installed at a time.

Configuration

Edit /etc/systemd/timesyncd.conf and set the NTP servers to ones reachable from within China, for example:

[Time]
NTP=ntp7.aliyun.com
NTP=ntp6.aliyun.com

After saving the file, restart the service for the changes to take effect:

sudo systemctl restart systemd-timesyncd.service

If the systemd-timesyncd.service unit is missing, you can restore it with:

sudo dpkg-reconfigure systemd-timesyncd

Verify Synchronization

Use timedatectl status to view detailed synchronization information, for example:

Local time: Tue 2020-09-22 20:06:05 CST
Universal time: Tue 2020-09-22 12:06:05 UTC
RTC time: Tue 2020-09-22 12:06:05
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active

Domestic NTP Server List

Some Alibaba Cloud NTP servers that can be used (choose the best with ping):

ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxNTPtime synchronizationUbuntuDebiansystemd-timesyncd
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.