Configure NTP Time Sync on Ubuntu/Debian in Isolated Environments
This guide shows how to manually install and configure systemd-timesyncd on Ubuntu or Debian, choose reachable NTP servers for China, restart the service, verify synchronization, and provides a list of domestic Alibaba Cloud NTP servers.
Ubuntu's default NTP server is ntp.ubuntu.com, while Debian uses 0.debian.pool.ntp.org, etc. These servers have high latency in China but still work for clock sync.
In isolated environments such as corporate intranets or cloud subnets without internet access, you must configure time sync manually.
This article explains how to configure time synchronization without setting up your own NTP server.
Installation
systemd-timesyncd is usually pre‑installed. If not, install it with: sudo apt install systemd-timesyncd Note that systemd-timesyncd conflicts with the ntp package; only one can be installed.
Configuration
Edit /etc/systemd/timesyncd.conf and set the NTP servers to ones reachable in China, for example:
[Time]
NTP=ntp7.aliyun.com
NTP=ntp6.aliyun.comAfter editing, restart the service for changes to take effect:
sudo systemctl restart systemd-timesyncd.serviceIf systemd-timesyncd.service is missing, recreate it with:
sudo dpkg-reconfigure systemd-timesyncdVerify the Result
Use timedatectl status to view synchronization status and other clock information.
$ timedatectl status
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
RTC in local TZ: noDomestic NTP Server List
Some Alibaba Cloud NTP servers you can ping and choose the best one:
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.comSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
