配置客户端

Apple macOS (OS X)

  1. 打开“系统偏好设置”。
  2. 选择“日期和时间”面板。
  3. 点击锁形图标即可进行更改。
  4. 输入密码。
  5. 选择“日期和时间”。
  6. 在“自动设置日期和时间”旁边的方框中,输入 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

ntpdchrony

  1. 使用您喜爱的文本编辑器修改 /etc/ntp.conf/etc/chrony/chrony.conf(具体取决于您使用的服务)。
  2. 移除或注释掉以 server 开头的任何行,以防止您的机器尝试混合使用涂抹服务器和非涂抹服务器。
  3. 添加以下代码行:

    server time1.google.com iburst
    server time2.google.com iburst
    server time3.google.com iburst
    server time4.google.com iburst
    
  4. 使用 sudo service ntp reloadsudo service chrony force-reload 重启 NTP/chrony 守护程序。

systemd-timesyncd

  1. 修改“/etc/systemd/timesyncd.conf
  2. [Time] 代码块的内容设置为:

    [Time]
    NTP=
    FallbackNTP=time.google.com
    

    如果将 NTP= 保持为未注释状态并分配给空字符串,则会重置 NTP 服务器列表,包括任何按接口分配的服务器。这样可以防止在模糊时间服务器和非模糊时间服务器之间意外移动。将 Google 公共 NTP 配置为后备服务器会导致它被选为唯一的 NTP 服务器。

  3. 使用 systemctl restart systemd-timesyncd.service 作为具有适当权限的用户重启 systemd-timesyncd

  4. 验证您的系统是否正在使用 timedatectl show-timesync | grep ServerName 的 Google 公共 NTP。如果配置成功,输出将显示:ServerName=time.google.com

Microsoft Windows

  1. 打开控制面板。
  2. 点击“日期和时间”图标。
  3. 选择“Internet Time”(网络时间)标签页。(如果您的电脑是网域的一部分,则无法使用此功能。在这种情况下,它会与网域控制器同步时间。您可以将控制器配置为使用 Google 公共 NTP。)
  4. 点击“更改设置…”按钮。
  5. 勾选“与互联网时间服务器同步”复选框。
  6. 在“服务器:”旁边,输入 time.google.com

Microsoft Windows Server

按照 Microsoft 的说明更新注册表。