Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a CentOS 6.4 server, it does not have any iptable rules, it runs NTP daemon as service using the following configuration:

  driftfile /var/lib/ntp/drift

  server 0.pool.ntp.org
  server 1.pool.ntp.org
  server 2.pool.ntp.org
  server 3.pool.ntp.org

  restrict default ignore
  restrict 127.0.0.1

When I run ntpq to query peers, the following response is received:

ntpq> peers
localhost.localdomain: timed out, nothing received

dig shows that:

localhost.localdomain.  86400   IN  A   127.0.0.1

Why doesn't ntp query work?

share|improve this question
1  
Do you have a local IPtables running? –  Sami Laine Dec 2 '13 at 7:08
    
iptable is running, but there isnt any rule. –  Howard Dec 2 '13 at 7:10
1  
And ntp-daemon is actually running? Try grep ntp /var/log* to see if there are some notices which might help? –  Sami Laine Dec 2 '13 at 7:27
    
are you able to ping 0.pool.ntp.org and others in the list ? –  slayedbylucifer Dec 2 '13 at 8:42
    
Do you have an entry for localhost or localhost.localdomain in /etc/hosts? The system will look here first, before checking DNS. –  Martin Apr 8 at 11:26
add comment

1 Answer

up vote 1 down vote accepted

I was expecting ntpq to query local server via 127.0.0.1, but it turns out to be querying local server via ethernet network interface.

Although I have no idea why a local ntp query would have to go through ethernet, but in configuration file I added

restrict <eht0 ip address>

And now NTP works fine.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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