开发者社区 问答 正文

服务器是如何通过网络对时的?

比如Linux如何获得网络时间?
有没有靠谱的国家对时服务器?
目前的网络对时都是怎么实现的?

谢谢!

展开
收起
a123456678 2016-06-21 11:10:51 2628 分享 版权
1 条回答
写回答
取消 提交回答
  • [root@localhost ~]# ntpdate pool.ntp.org
    22 Jan 02:05:13 ntpdate[15078]: step time server 67.18.208.203 offset -43140.643826 sec
    [root@localhost ~]# ntpdate pool.ntp.org
    22 Jan 02:05:26 ntpdate[15092]: adjust time server 67.18.208.203 offset 0.000080 sec
    开机自启动ntpd:
    
    chkconfig ntpd on
    配置ntp服务器:
    
    vim /etc/ntp.conf
    添加服务器,理论上地理位置靠得近的,误差会更小一些:
    
    server 1.cn.pool.ntp.org
    server 1.asia.pool.ntp.org
    server 3.asia.pool.ntp.org 
    2019-07-17 19:44:39
    赞同 展开评论