ntpdate XXX works ; ntpdate -q XXX don't works - ntpd stays on local
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ntpdate XXX works ; ntpdate -q XXX don't works - ntpd stays on local
Hi,
I have a problem with my ntp service (on Centos 4) : the ntp stay synchronized on local, not on the reference.
After searching for 2 days on the web, i've not yet found the solution.
I tried to use ntpdate to query only the ntp server :
Code:
# /usr/sbin/ntpdate -q XX.XX.XX.XX
server XX.XX.XX.XX, stratum 0, offset 0.000000, delay 0.00000
8 Dec 17:51:30 ntpdate[19016]: no server suitable for synchronization found
but i can cynchronize the clock :
Code:
# /usr/sbin/ntpdate XX.XX.XX.XX
8 Dec 17:37:24 ntpdate[30430]: adjust time server XX.XX.XX.XX offset -0.029291 sec
When ntpd is running, ntpq -p tell me that the synchronisation is done on LOCAL(0) and not on XX.XX.XX.XX
ntp.conf :
Code:
restrict default nomodify notrap
server XX.XX.XX.XX prefer
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
cat /etc/ntp.conf
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 nomodify
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 127.0.0.0 mask 255.0.0.0 nomodify nopeer notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org prefer
server 1.centos.pool.ntp.org burst iburst
server 2.centos.pool.ntp.org
#broadcast 192.168.1.255 key 42 # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 key 42 # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 key 42 # manycast client
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server 127.127.1.0
fudge 127.127.1.0 stratum 10
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
Shall we assume your time server is on your LAN since you have used xx.xx.xx.xx?
Post the output of ntpq -p of the client and also the ntp.conf from your timer server.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.