一.為什么要切換使用阿里雲的公共NTP服務器呢?
NTP 是網絡時間協議 (Network Time Protocol),它是用來同步網絡中各個計算機的時間的協議。
為什么修改雲服務器的DNS呢,中國時間服務器,國內阿里雲時間服務器
很多用戶使用的是國外VPS
使用過程中常常遇到時間與國內不同步的情況
好在阿里提供了NTP服務器,地址如下:
阿里雲鏡像站官網:https://developer.aliyun.com/mirror/
阿里雲NTP服務器官網:https://developer.aliyun.com/mirror/NTP
二.如何切換使用阿里雲NTP服務器。
Linux 服務器上快速配置阿里巴巴 OPSX NTP服務
編輯文件 "/etc/ntp.conf",根據情況修改文件內容為:
- 互聯網上的服務器:
driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 10
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery
- 阿里雲 ECS 服務器:
driftfile /var/lib/ntp/drift
pidfile /var/run/ntpd.pid
logfile /var/log/ntp.log
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 10
server ntp.aliyun.com iburst minpoll 4 maxpoll 10
restrict ntp.aliyun.com nomodify notrap nopeer noquery
server ntp1.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp1.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp2.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp2.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp3.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp3.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp4.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp4.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp5.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp5.cloud.aliyuncs.com nomodify notrap nopeer noquery
server ntp6.cloud.aliyuncs.com iburst minpoll 4 maxpoll 10
restrict ntp6.cloud.aliyuncs.com nomodify notrap nopeer noquery
三.其他公共推薦的NTP服務器
使用以前請先ping相應的域名查看網絡是否可達,和相應的訪問速度
ntp.ntsc.ac.cn 中國國家授時中心
cn.ntp.org.cn 中國授時
阿里雲NTP時間源服務器
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com
國內一些大學NTP時間源服務器
s1a.time.edu.cn 北京郵電大學
s1b.time.edu.cn 清華大學
s1c.time.edu.cn 北京大學
s1d.time.edu.cn 東南大學
s1e.time.edu.cn 清華大學
s2a.time.edu.cn 清華大學
s2b.time.edu.cn 清華大學
s2c.time.edu.cn 北京郵電大學
s2d.time.edu.cn 西南地區網絡中心
s2e.time.edu.cn 西北地區網絡中心
s2f.time.edu.cn 東北地區網絡中心
s2g.time.edu.cn 華東南地區網絡中心
s2h.time.edu.cn 四川大學網絡管理中心
s2j.time.edu.cn 大連理工大學網絡中心
s2k.time.edu.cn CERNET桂林主節點
s2m.time.edu.cn 北京大學
另外,如果服務器在國外,蘋果提供的公共NTP服務,以下7個域名
http://time1.apple.com
http://time2.apple.com
http://time3.apple.com
http://time4.apple.com
http://time5.apple.com
http://time6.apple.com
http://time7.apple.com
Google(谷歌)提供的NTP服務,以下4個域名
http://time1.google.com
http://time2.google.com
http://time3.google.com
http://time4.google.com