配置客户端
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Apple macOS (OS X)
- 打开“系统偏好设置”。
- 选择“日期和时间”面板。
- 点击锁形图标即可进行更改。
- 输入密码。
- 选择“日期和时间”。
- 在“自动设置日期和时间”旁边的方框中,输入
time.google.com
。
Cisco IOS 和 NX-OS
router# config t
Enter configuration commands, one per line. End with CNTL/Z.
router(config)# no ntp server
router(config)# ntp server time1.google.com
router(config)# ntp server time2.google.com
router(config)# ntp server time3.google.com
router(config)# ntp server time4.google.com
router(config)# copy running-config startup-config
Google Compute Engine
虽然您可以从 Compute Engine 使用 Google 公共 NTP,但私有云服务器的性能更好,它们使用相同的弥补方式提供相同的时间。请按照这些说明操作。
Juniper Junos
NTP 是在 [edit system ntp]
层次结构级别配置的:
system {
ntp {
server time1.google.com;
server time2.google.com;
server time3.google.com;
server time4.google.com;
}
}
Linux
ntpd
或 chrony
- 使用您喜爱的文本编辑器修改
/etc/ntp.conf
或 /etc/chrony/chrony.conf
(具体取决于您使用的服务)。
- 移除或注释掉以
server
开头的任何行,以防止您的机器尝试混合使用涂抹服务器和非涂抹服务器。
添加以下代码行:
server time1.google.com iburst
server time2.google.com iburst
server time3.google.com iburst
server time4.google.com iburst
使用 sudo service ntp reload
或 sudo
service chrony force-reload
重启 NTP/chrony 守护程序。
systemd-timesyncd
- 修改“
/etc/systemd/timesyncd.conf
”
将 [Time]
代码块的内容设置为:
[Time]
NTP=
FallbackNTP=time.google.com
如果将 NTP=
保持为未注释状态并分配给空字符串,则会重置 NTP 服务器列表,包括任何按接口分配的服务器。这样可以防止在模糊时间服务器和非模糊时间服务器之间意外移动。将 Google 公共 NTP 配置为后备服务器会导致它被选为唯一的 NTP 服务器。
使用 systemctl restart
systemd-timesyncd.service
作为具有适当权限的用户重启 systemd-timesyncd
验证您的系统是否正在使用 timedatectl
show-timesync | grep ServerName
的 Google 公共 NTP。如果配置成功,输出将显示:ServerName=time.google.com
Microsoft Windows
- 打开控制面板。
- 点击“日期和时间”图标。
- 选择“Internet Time”(网络时间)标签页。(如果您的电脑是网域的一部分,则无法使用此功能。在这种情况下,它会与网域控制器同步时间。您可以将控制器配置为使用 Google 公共 NTP。)
- 点击“更改设置…”按钮。
- 勾选“与互联网时间服务器同步”复选框。
- 在“服务器:”旁边,输入
time.google.com
。
Microsoft Windows Server
按照 Microsoft 的说明更新注册表。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThis guide provides instructions for configuring various operating systems and network devices to utilize Google Public NTP servers for time synchronization.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Public NTP offers improved performance compared to other NTP sources, especially within Google Compute Engine.\u003c/p\u003e\n"],["\u003cp\u003eThe configurations typically involve specifying \u003ccode\u003etime.google.com\u003c/code\u003e or a series of Google NTP server addresses (time1.google.com, time2.google.com, etc.) in your system's time settings or configuration files.\u003c/p\u003e\n"],["\u003cp\u003eDepending on your platform, you may need to restart specific services or daemons for the changes to take effect.\u003c/p\u003e\n"],["\u003cp\u003eFor domain-joined Windows PCs and Windows Servers, special considerations or registry modifications may be necessary.\u003c/p\u003e\n"]]],["To configure systems to use Google Public NTP, users must specify `time.google.com` as the NTP server in their system settings. On macOS, this involves adjusting the \"Date & Time\" panel. Cisco devices use commands such as `no ntp server` and `ntp server`. Linux requires editing configuration files like `/etc/ntp.conf` or `/etc/systemd/timesyncd.conf`, followed by service restarts. Windows involves adjusting the \"Internet Time\" settings, while Windows Server requires registry modifications. Juniper devices modify the ntp settings under the system configuration.\n"],null,[]]