配置客户端

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. 选择“互联网时间”标签页。(如果您的 PC 属于网域,则无法执行此操作。在这种情况下,它会与网域控制器同步时间。您可以将控制器配置为使用 Google 公共 NTP。)
  4. 点击“更改设置...”按钮。
  5. 勾选“与互联网时间服务器同步”复选框。
  6. 在“服务器:”旁边,输入 time.google.com

Microsoft Windows Server

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