Welcome to MSDN Blogs Sign in | Join | Help

Windows Time Service

The official blog site for the Windows Time Service
Configuring the Time Service: NtpServer and SpecialPollInterval

One of the most talked about configuration options for W32Time has to be the list of time sources that W32Time connects to for synchronization. It is important to note that W32Time will only actively synchronize with one time source at a time, even though you are able to list more than one time source. The reason for this is simple: If your favorite time source goes down, it would be good to have a backup, or possibly a list of backups.

W32Time configures the list of time sources through the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer

The NtpServer key is a space-delimited list of time servers, either as DNS address or as IP addresses. Each server in the list can optionally have a set of flags, which are denoted as a hex value at the end of the address, separated by a comma. We will get to the flags in a moment. Here are a few examples of NtpServer values:

time.windows.com,0x01

time.windows.com,0x01 time.nist.gov,0x01 my.time.server.com,0x02

In the first example, we are specifying a time source of time.windows.com, with the 0x01 and 0x08 flags. In the second example, we are specifying 3 time sources, each with a different set of flags (0x01 & 0x08; 0x01; 0x02 respectively).

Now lets take a look at the flags. We have 4 possible flags:

0x01 SpecialInterval

0x02 UseAsFallbackOnly

0x04 SymmatricActive

0x08 Client

For 99% of cases, we only care about the first two options, so that is where we will focus. If you use the SpecialInterval flag, then you need to also set the "SpecialPollInterval" key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\
NtpClient\SpecialPollInterval

Normally, W32Time will poll (make a time request) on a floating interval, based on the quality of the time samples being returned by the time source. You can however specify a static interval that the time service will syncronize on. This value is in seconds. For example, if you set a of 3600, the time service will syncronize every hour (60 minutes * 60 seconds).

The second flag is the UseAsFallbackOnly option. Setting this flag will tell the time service that you want to try every other time server specified before trying this one.

That wraps up this one. As usual, If you have specific thoughts or questions about this post, please feel free to leave a comment. For general questions about w32time, especially if you have problems with your w32time setup, I encourage you to ask them on Directory Services section of the Microsoft Technet forums.

Posted: Tuesday, February 26, 2008 3:11 PM by Ryan Sizemore
Filed under:

Comments

Frank said:

Hi, just wanted to say this is an excellent article.  This finally have cleared up one of my confusions about setting up NTP, namely: Why does MS tell me I have to add ,0x1 to the end of a DNS name?  http://support.microsoft.com/kb/816042

Reading that KB article again, it's really perfectly clear the way they state it.  For some reason though I always mis-interpreted the meaning until now.  I thought the ,0x1 was somehow telling Windows that it's a DNS name, rather than an IP address.  (Obviously that would be dumb.)

Finally makes sense now though.  Thanks!

# March 18, 2008 10:07 PM

Ryan Sizemore said:

Glad to hear you like it. If you can think of any other topics that have you puzzled regarding w32time, let me know and I'll try to add some clarification.

# March 18, 2008 10:15 PM

Frank said:

Actually, now that you mention it, why does the article recommend using 0x1?  Is there something wrong with letting NTP decide the interval on its own?

# March 20, 2008 9:11 PM

Ryan Sizemore said:

Nope, nothing wrong with that at all. Most domain admins prefer to have the PDC (or root time source) sync at a regular interval, so this post mirrors those requests.

# March 21, 2008 1:39 AM

brorymes said:

Just checking (possible typo?):

In both examples, time.windows.com is followed by 0x01, although you indicate that both the 0x01 and 0x08 flags apply (i.e. SpecialInterval + Client).

Shouldn't time.windows.com be followed by 0x09 in both examples, since (0x01 OR 0x08) = 0x09?

# June 5, 2008 2:14 PM

Gary said:

Ryan,

Just had a time problem that caused me to do some research on W32Time. We have two time sources defined but the active one had a problem which caused a change of time by 365 days. The question was can W32Time be configured to sample two times sources and compare them, if I'm reading correctly then this is not possible.

Regards,

# October 8, 2008 9:43 AM

Ryan Sizemore said:

Gary:

It would be best to ask these questions on the forums, but nonetheless...

If a feature like that existed, how would we know which one was the correct one? The correct way to solve this is to impose a set of limits on the phase correction. See the article above about Max*PhaseCorrection. This will limit the size of the time jump that w32time can make, thus preventing your 365 day jumps.

In Windows Server 2008, we imposed a new set of default limits of 48 hours to prevent this type of problem. You should consider setting those same limits in your environment.

Ryan

# October 8, 2008 12:14 PM

Gus said:

Do I need special software for my MS web server 2003 to synchronize my routers time. I am trying to use the ntp services on my cisco devices to get the time from my web server using only W32time services. What a drag!!!

# December 13, 2008 5:34 PM

Ryan Sizemore said:

No, you don't need special software. You need to enable the NtpServer, which will allow your cisco device to sync with the web server. Take a look at the article titled "Configuring a Standalone NtpServer". It should cover everything you need.

Ryan

# December 13, 2008 7:32 PM

Donno Cole said:

I find that when using an IP address for the time server, the 0x01 switch is not being applied properly.  The IP address fails to resolve and no time packets are received from the server.  

Is there a trick to get it to work with an IP address?

Thank you!

# October 19, 2009 6:52 AM

Ryan Sizemore said:

Hi Donno,

Using an IP address should be no different than using a DNS name. For example, "123.234.12.23,0x01" should be all that you need.

# October 19, 2009 8:34 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker