i've a problem with time syncronization of a CentOS 7 host with a Windows 2008 R2 Domain controller. If I use the command ntpdate -u host.domain the synchronization is ok. But using ntpd the time is always the same, here the result of the command ntpq -p:    .LOCL.           1 u   65   64  377    1.740  965414.   4.054     2 u   62   64  377    1.912  965408.  12.899

and the ntp.conf is the following:

driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict ::1
server iburst prefer
server iburst
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
logfile /var/log/ntp.log

Centos 7 use systemd. I suggest you use it.

Use the command timedatectl

Enable network time synchronization:

timedatectl set-ntp True

Create a conf file:

vi /etc/systemd/timesyncd.conf

with content like this:

[Time] NTP= yourserver.org

Start systemd-timedated service:

systemctl start systemd-timedated
|improve this answer|||||
  • Umm, I don't believe centos chose to include systemd-timesyncd and so manufacturing a /etc/systemd/timesyncd.conf would have no effect. I'm willing to be corrected but systemd-timedated does not read this file. See unix.stackexchange.com/a/312716/80414 – shalomb Jul 9 '18 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.