Linux 系统时间同步

来源:互联网 发布:gitbook mac客户端 编辑:程序博客网 时间:2024/03/29 05:15
查看硬件时间
#hwclock --show

设置硬件时间
# hwclok --set --date="月/日/年 时:分:秒"

以硬件时间为基准,修改系统时间
# hwclock --hctosys
# hwclock -s


自动同步服务器时间:
# yum install ntp
# chkconfig ntpd on
# ntpdate pool.ntp.org
# /etc/init.d/ntpd start


1、错误:

etc]# ntpdate us.pool.ntp.org
Error : Temporary failure in name resolution
 3 Jun 02:39:35 ntpdate[27430]: can't find host us.pool.ntp.org

 3 Jun 02:39:35 ntpdate[27430]: no servers can be used, exiting

2、解决方法:设置DNS服务器

vi /etc/resolv.conf

添加: nameserver 8.8.8.8
          nameserver 8.8.4.4

或者
nameserver 202.106.196.115
原创粉丝点击