Operations 3 min read

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.

Open Source Linux
Open Source Linux
Open Source Linux
Configure NTP Time Sync on Ubuntu/Debian in Isolated Environments

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.com

After editing, restart the service for changes to take effect:

sudo systemctl restart systemd-timesyncd.service

If systemd-timesyncd.service is missing, recreate it with:

sudo dpkg-reconfigure systemd-timesyncd

Verify 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: no

Domestic 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.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
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

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.