运行ntpdate报错:Temporary failure in name resolution


一、问题报错:

忽然发现某台机器时间慢了些几分钟,之前没有搭建ntpd服务,目前都是使用的ntpdate加定时任务进行时间同步。直接执行ntpdate报错如下:

# ntpdate cn.pool.ntp.org
Exiting, name server cannot be used: Temporary failure in name resolution (-3) 3 Sep 15:46:46 ntpdate[13742]: name server cannot be used: Temporary failure in name resolution (-3)

二、问题原因:

一般报错为Temporary failure in name resolution为无法解析,经测试ping也不通。所以判断为resolv.conf文件问题

# ping www.baidu.com
ping: unknown host www.baidu.com

三、解决方法:

  可根据网络供应商填写正确的DNS地址

# cat /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8

# ntpdate cn.pool.ntp.org
 3 Sep 17:54:33 ntpdate[17314]: step time server 5.103.139.163 offset 995.587830 sec


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM