日々精進

新しく学んだことを書き留めていきます

ubuntuでntpdateを実行したり、ntpdを動かしても時刻を同期できない

以下のようなエラーが出る。

sudo ntpdate -d timeserver
12 Dec 15:58:00 ntpdate[30741]: ntpdate 4.2.6p3@1.2290-o Tue Jun  5 20:12:09 UTC 2012 (1)
Looking for host timeserver and service ntp
Exiting, name server cannot be used: Temporary failure in name resolution (-3)12 Dec 15:58:20 ntpdate[30741]: name server cannot be used: Temporary failure in name resolution (-3)

原因はProxyサーバが123/UDPポートを開放してないためだった。
しょうがないのでひとまず以下を実行して手動で時計を合わせた。httpの上にntpを乗せて時刻同期とかできないのかな。。

sudo date -s "12/12 15:56 2013"

参考:Time Synchronisation with NTP
 http://lets-ubuntu.yui.at/tips/tips_ntp.html
 ubuntu 手動時刻合わせ - MEMOcho-