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):

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

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

C:\>w32tm /query /peers
#Peers: 4

Peer: 0.be.pool.ntp.org
State: Active
Time Remaining: 595.8760000s
Mode: 3 (Client)
Stratum: 3 (secondary reference - syncd by (S)NTP)
PeerPoll Interval: 10 (1024s)
HostPoll Interval: 10 (1024s)

Peer: 1.be.pool.ntp.org
State: Active
Time Remaining: 595.8760000s
Mode: 3 (Client)
Stratum: 2 (secondary reference - syncd by (S)NTP)
PeerPoll Interval: 10 (1024s)
HostPoll Interval: 10 (1024s)

Peer: 2.be.pool.ntp.org
State: Active
Time Remaining: 595.8760000s
Mode: 3 (Client)
Stratum: 2 (secondary reference - syncd by (S)NTP)
PeerPoll Interval: 10 (1024s)
HostPoll Interval: 10 (1024s)

Peer: 3.be.pool.ntp.org
State: Active
Time Remaining: 595.8760000s
Mode: 3 (Client)
Stratum: 2 (secondary reference - syncd by (S)NTP)
PeerPoll Interval: 10 (1024s)
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:

net stop w32time
net start w32time
w32tm /query /configuration

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

SpecialPollInterval: 43200 (Local)
Type: NTP (Local)
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:

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