HOWTO: Set up NTP on Windows Vista

By default, Windows Vista synchronizes once every 7 days with time.windows.com along with every other user out there.

Let's change this to sync every half day with several NTP servers to get a more reliable time.

First of all go to the NTP Pool Project and browse to the page of your country, I'll use the Belgium NTP Pool as an example.

Let's start with the simple change and click on your system clock and select change date and time settings...

On the tab Internet Time select Change settings... and as a server, enter the name of your country's main pool, be.pool.ntp.org for Belgium. Press Update now to test it, and finally close all windows again.

At this point you're randomly picking an NTP server in your country for your weekly update. Let's improve this a bit by adding multiple servers.

Open an administrative command prompt and enter the following command (replace the server names by the list of your country, space separated, surrounded by double quotes):

CODE:
  1. net time /setsntp:"0.be.pool.ntp.org 1.be.pool.ntp.org 2.be.pool.ntp.org 3.be.pool.ntp.org"
  2. w32tm /query /peers
  3. net stop w32time
  4. net start w32time
  5. w32tm /resync
  6. w32tm /query /peers

You will have noticed there are now four NTP servers in the list.

CODE:
  1. C:\>w32tm /query /peers
  2. #Peers: 4
  3.  
  4. Peer: 0.be.pool.ntp.org
  5. State: Active
  6. Time Remaining: 595.8760000s
  7. Mode: 3 (Client)
  8. Stratum: 3 (secondary reference - syncd by (S)NTP)
  9. PeerPoll Interval: 10 (1024s)
  10. HostPoll Interval: 10 (1024s)
  11.  
  12. Peer: 1.be.pool.ntp.org
  13. State: Active
  14. Time Remaining: 595.8760000s
  15. Mode: 3 (Client)
  16. Stratum: 2 (secondary reference - syncd by (S)NTP)
  17. PeerPoll Interval: 10 (1024s)
  18. HostPoll Interval: 10 (1024s)
  19.  
  20. Peer: 2.be.pool.ntp.org
  21. State: Active
  22. Time Remaining: 595.8760000s
  23. Mode: 3 (Client)
  24. Stratum: 2 (secondary reference - syncd by (S)NTP)
  25. PeerPoll Interval: 10 (1024s)
  26. HostPoll Interval: 10 (1024s)
  27.  
  28. Peer: 3.be.pool.ntp.org
  29. State: Active
  30. Time Remaining: 595.8760000s
  31. Mode: 3 (Client)
  32. Stratum: 2 (secondary reference - syncd by (S)NTP)
  33. PeerPoll Interval: 10 (1024s)
  34. HostPoll Interval: 10 (1024s)

When you run w32tm /query /configuration you will notice the SpecialPollInterval setting will list 604800, which is 7 days in seconds.

To change the interval, open up regedit, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient and locate the SpecialPollInterval DWORD value.

Change this to Decimal 43200 (Hex 0000a8c0), which is equal to 12 hours in seconds.

Close regedit and execute the following commands:

CODE:
  1. net stop w32time
  2. net start w32time
  3. w32tm /query /configuration

This will now return a lot information, including the following lines:

CODE:
  1. SpecialPollInterval: 43200 (Local)
  2. Type: NTP (Local)
  3. NtpServer: 0.be.pool.ntp.org 1.be.pool.ntp.org 2.be.pool.ntp.org 3.be.pool.ntp.org (Local)

Congratulations, at this point you are succesfully syncing your computer every 12 hours against multiple NTP servers.

I've done this as a result of my previous IPv6 tunnel article, to make sure I'm running nearly equal with SixXS, which you can check at SixXS Time Check.

Update:
Windows 7 deprecated net time /setsntp, use this instead:

CODE:
  1. w32tm /config /manualpeerlist:"0.be.pool.ntp.org 1.be.pool.ntp.org 2.be.pool.ntp.org 3.be.pool.ntp.org"

3 reacties op “HOWTO: Set up NTP on Windows Vista”

  1. [...] han sido recopilados de Time Synchronisation with NTP de la documentación oficina de Ubuntu y HOWTO: Set up NTP on Windows Vista de [...]

  2. Jeff zegt:

    Thanks for the article. One note, when using a list of servers with w32tm and the /manualpeerlist switch, the switch must be enclosed in quotes. The correction to your Windows 7 command would be:

    w32tm /config “/manualpeerlist:0.be.pool.ntp.org 1.be.pool.ntp.org 2.be.pool.ntp.org 3.be.pool.ntp.org”

    -Jeff

  3. gn zegt:

    On Windows 7 Ultimate x64 I have following problem:

    C:\>net start w32time
    The Windows Time service is starting.
    The Windows Time service was started successfully.

    C:\>w32tm /config /manualpeerlist:”0.jp.pool.ntp.org 1.jp.pool.ntp.org 2.jp.pool.ntp.org 3.jp.pool.ntp.org”
    The command completed successfully.

    C:\>w32tm /query /peers
    The following error occurred: The specified module could not be found. (0×8007007E)

    C:\>w32tm /query /status
    The following error occurred: The specified module could not be found. (0×8007007E)

    C:\>w32tm /query /configuration
    The following error occurred: The specified module could not be found. (0×8007007E)

    C:\>w32tm /resync
    The following error occurred: The specified module could not be found. (0×8007007E)

    Any thoughts? “:)”

Reageer