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 的说明更新注册表。