0

I have gone through several tutorials regarding NTP and synchronizing the system clock, but I am still not able to get my system's time right. I followed the following steps on a machine running Ubuntu 16.04 LTS:

  1. Installed ntp and ntpdate
  2. Edited the /etc/ntp.conf file to contain the following:

    driftfile /var/lib/ntp/ntp.drift
    server 0.pool.ntp.org iburst
    server 1.pool.ntp.org iburst
    server 2.pool.ntp.org iburst
    server 3.pool.ntp.org iburst`
    
  3. Started the ntp service with sudo /etc/init.d/ntp start

To check if everything was working, I ran ntpstat and got this output:

unsynchronised
   polling server every 8 s

Checking with ntpdc -c peers returned:

localhost: timed out, nothing received
***Request timed out

ntpq -p gives:

   `remote          refid           st t when poll reach   delay    offset jitter`
   `==============================================================================`
   `propjet.latt.ne .INIT.          16 u    -  512    0    0.000    0.000   0.000`
   `duffman.whacker .INIT.          16 u    -  512    0    0.000    0.000   0.000`
   `ec2-52-6-191-28 .INIT.          16 u    -  512    0    0.000    0.000   0.000`

   `104.131.53.252  .INIT.          16 u    -  512    0    0.000    0.000   0.000`

Even after all of this, my clock is still off by almost 10 minutes, and I'm not sure what the issue is.

I am running a local machine, but it is behind a corporate proxy. However, I've included the proxy information as environment variables.

Are there any corrections that I can make to fix this?

  • 1
    Your computer cannot communicate with the NTP servers. Investigate why. Can you ping www.google.com? Also, on 16.04 you really should use sudo systemctl start ntp not call directly the script in /etc/init.d. – AlexP Dec 12 '16 at 15:48
  • Are you running a local machine or a server in a datacenter/cloud service? NTP has been used for amplification DoS attacks in the past, so it's possible that your provider blocks in/out NTP traffic. – Ulrich Schwarz Dec 12 '16 at 15:48
  • @AlexP i cannot ping www.google.com. @UlrichSchwarz I am running a local machine, but it is behind a corporate proxy. However, I've included the proxy information as environment variables. – rafafan2010 Dec 12 '16 at 15:56
  • 6
    If you cannot ping www.google.com then your computer does not have direct access to the internet. You may be behind a corporate firewall. Ask the local gurus for the time servers on the intranet. – AlexP Dec 12 '16 at 15:58
  • 1) ask IT folks 2) try local router as ntp server. – Archemar Dec 13 '16 at 9:01
2

I am running a local machine, but it is behind a corporate proxy. However, I've included the proxy information as environment variables

Web proxy information is irrelevant to non-HTTP protocols such as NTP. You will need to speak with your corporate IT group to get them to give you access either to their local NTP servers, or to the set of external NTP servers you propose to use. (It would be possible in the second case that you would have to define that set of servers rather than using the dynamic *.pool.ntp.org names.)

-1

There are lots of ntp questions and they all have the same mistake: people using SERVER on an ntp pool and POOL on an ntp server:

server 0.pool.ntp.org iburst

As the URL says, it's a POOL. Try

pool 0.pool.ntp.org iburst

instead or actually use a server, not a pool ...

Furthermore, most people have a timesource in their network, most often Windows Domain Controllers. If this is true for you, why messing with external ntp servers when you could use internal NTP of Windows DC ...

(I am not sure if you can use iburst on a pool.)

  • 1
    They don't "all have the same mistake". True, the relatively new pool keyword should in a growing number of places be used instead of server, but server is not wrong merely suboptimal. In the particular situation here, it's likely that pool would exacerbate the problem by hiding the necessary IP addresses and making it even harder to get the data through what turns out to be a corporate firewall. – roaima Apr 10 '17 at 19:22

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.