1. 程式人生 > >運行ntpdate報錯:Temporary failure in name resolution

運行ntpdate報錯:Temporary failure in name resolution

使用 問題 -s dns fail 解決 分鐘 方法 span

發現問題:

  忽然發現某臺機器時間慢了些幾分鐘,之前沒有搭建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

運行ntpdate報錯:Temporary failure in name resolution