การกําหนดค่าไคลเอ็นต์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
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
แม้ว่าคุณจะใช้ NTP สาธารณะของ Google จาก Compute Engine ได้ แต่เซิร์ฟเวอร์ในระบบคลาวด์ส่วนตัวจะให้ประสิทธิภาพที่ดีกว่า
ซึ่งจะแสดงเวลาเดียวกันโดยใช้การเลื่อนเวลาเดียวกัน ทำตามวิธีการเหล่านี้
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
รีสตาร์ท NTP/chrony daemon โดยใช้ sudo service ntp reload
หรือ sudo
service chrony force-reload
systemd-timesyncd
- แก้ไข
/etc/systemd/timesyncd.conf
ตั้งค่าเนื้อหาของบล็อก [Time]
เป็น
[Time]
NTP=
FallbackNTP=time.google.com
การปล่อยให้NTP=
ไม่มีการแสดงความคิดเห็นและกำหนดให้กับสตริงว่างจะรีเซ็ตรายการ
เซิร์ฟเวอร์ NTP รวมถึงการกำหนดต่ออินเทอร์เฟซ ซึ่งจะช่วยป้องกันไม่ให้มีการสลับไปมาระหว่างเซิร์ฟเวอร์เวลาที่ปรับและไม่ได้ปรับโดยไม่ตั้งใจ
การกำหนดค่า NTP สาธารณะของ Google เป็นเซิร์ฟเวอร์สำรองจะทำให้ระบบเลือก NTP สาธารณะของ Google เป็นเซิร์ฟเวอร์ NTP เพียงเซิร์ฟเวอร์เดียว
รีสตาร์ท systemd-timesyncd
โดยใช้ systemctl restart
systemd-timesyncd.service
เป็นผู้ใช้ที่มีสิทธิ์ที่เหมาะสม
ตรวจสอบว่าระบบใช้ NTP สาธารณะของ Google กับ timedatectl
show-timesync | grep ServerName
หากกำหนดค่าสำเร็จ เอาต์พุต
จะแสดงดังนี้ ServerName=time.google.com
Microsoft Windows
- เปิดแผงควบคุม
- คลิกไอคอน "วันที่และเวลา"
- เลือกแท็บ "เวลาอินเทอร์เน็ต" (ตัวเลือกนี้จะไม่พร้อมใช้งานหาก PC ของคุณเป็นส่วนหนึ่งของโดเมน ในกรณีดังกล่าว ระบบจะซิงค์เวลากับตัวควบคุมโดเมน
คุณสามารถกำหนดค่าตัวควบคุมให้ใช้ NTP สาธารณะของ Google ได้)
- คลิกปุ่ม "เปลี่ยนการตั้งค่า..."
- เลือกช่อง "ซิงค์กับเซิร์ฟเวอร์เวลาในอินเทอร์เน็ต"
- ป้อน
time.google.com
ข้าง "เซิร์ฟเวอร์"
Microsoft Windows Server
ทำตามวิธีการของ Microsoft
เพื่ออัปเดตรีจิสทรี
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\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,["# Configuring Clients\n\nApple macOS (OS X)\n------------------\n\n1. Open System Preferences.\n2. Choose the \"Date \\& Time\" panel.\n3. Click the lock to make changes.\n4. Enter your password.\n5. Select \"Date \\& Time\".\n6. In the box next to \"Set date and time automatically\", enter `time.google.com`.\n\nCisco IOS and NX-OS\n-------------------\n\n router# config t\n Enter configuration commands, one per line. End with CNTL/Z.\n router(config)# no ntp server\n router(config)# ntp server time1.google.com\n router(config)# ntp server time2.google.com\n router(config)# ntp server time3.google.com\n router(config)# ntp server time4.google.com\n router(config)# copy running-config startup-config\n\nGoogle Compute Engine\n---------------------\n\nAlthough you can use Google Public NTP from Compute Engine, you will get better\nperformance from the private cloud servers, which serve the same time using the\nsame smear. Follow\n[these instructions](https://cloud.google.com/compute/docs/instances/configure-ntp).\n\nJuniper Junos\n-------------\n\nNTP is configured at the `[edit system ntp]` hierarchy level: \n\n system {\n ntp {\n server time1.google.com;\n server time2.google.com;\n server time3.google.com;\n server time4.google.com;\n }\n }\n\nLinux\n-----\n\n### `ntpd` or `chrony`\n\n1. Edit `/etc/ntp.conf` or `/etc/chrony/chrony.conf` (depending on the service you're using) using your favorite text editor.\n2. Remove or comment out any lines starting with `server`, to prevent your machine from trying to mix smeared and non-smeared servers.\n3. Add the lines:\n\n server time1.google.com iburst\n server time2.google.com iburst\n server time3.google.com iburst\n server time4.google.com iburst\n\n4. Restart the NTP/chrony daemon using `sudo service ntp reload` or `sudo\n service chrony force-reload`.\n\n### `systemd-timesyncd`\n\n1. Edit `/etc/systemd/timesyncd.conf`\n2. Set the content of the `[Time]` block to:\n\n [Time]\n NTP=\n FallbackNTP=time.google.com\n\n Leaving `NTP=` uncommented and assigned to an empty string resets the list\n of NTP servers, including any per-interface assignments. This prevents\n inadvertently moving between smeared and un-smeared time servers.\n Configuring Google Public NTP as the fallback server will cause it to be\n selected as the only NTP server.\n3. Restart `systemd-timesyncd` using `systemctl restart\n systemd-timesyncd.service` as a user with appropriate permissions\n\n4. Verify that your system is using Google Public NTP with `timedatectl\n show-timesync | grep ServerName`. If successfully configured, the output\n will show: `ServerName=time.google.com`\n\nMicrosoft Windows\n-----------------\n\n1. Open the Control Panel.\n2. Click the \"Date and Time\" icon.\n3. Choose the \"Internet Time\" tab. (This will not be available if your PC is part of a domain. In that case, it will synchronize time with the domain controller. You can configure the controller to use Google Public NTP.)\n4. Click the \"Change settings...\" button.\n5. Check the box \"Synchronize with an Internet time server\".\n6. Next to \"Server:\", enter `time.google.com`.\n\nMicrosoft Windows Server\n------------------------\n\nFollow [Microsoft's instructions](https://support.microsoft.com/en-us/kb/816042)\nto update your registry."]]