다음을 통해 공유


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.

Comments

  • Anonymous
    March 18, 2008
    The comment has been removed

  • Anonymous
    March 18, 2008
    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.

  • Anonymous
    March 20, 2008
    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?

  • Anonymous
    March 20, 2008
    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.

  • Anonymous
    June 05, 2008
    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?

  • Anonymous
    October 08, 2008
    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,

  • Anonymous
    October 08, 2008
    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

  • Anonymous
    December 13, 2008
    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!!!

  • Anonymous
    December 13, 2008
    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

  • Anonymous
    October 18, 2009
    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!

  • Anonymous
    October 19, 2009
    The comment has been removed

  • Anonymous
    February 22, 2012
    Hi, very good post thanks. Echoing, Brorymes' question. It's a little confusing to me as you write [peer1],0x01 [peer2],0x01 but then go on to say that you've set peer1 with 0x01 and 0x08 and set peer2 with 0x01. Can you clarify please? Should it read [peer1],0x09 [peer2],0x01? Some more questions of my own; Will my server use that list in order. So it will try peer1 and only try peer2 if peer1 is unavailable? If not then how does the logic work on which source it picks. What is the 0x04 flag for? Thanks.

  • Anonymous
    March 03, 2012
    I'm questioning now whether multiple NTP servers are used in the order listed or in some round-robin fashion.  I set two NTP servers in the Domain Controller Group Policy Object so that both of my DCs would sync to an external source in case I ever need to move the PDC role from one to the other.  Even though the same GPO was used to configure both DCs, one DC is using the first NTP server (determined with w32tm /query /source) and the other is using the second.

  • Anonymous
    March 03, 2012
    I've spent all day chasing some of these issues and THEN (of course) I found this article.  So to answer a few open questions: The default setting for the NtpServer parameter in the registry key HKLMSYSTEMCurrentControlSetServicesW32TimeParameters is time.windows.com,0x9 in Server 2008 and 2008 R2 (which you can directly inspect by typing w32tm /dumpreg /subkey:parameters at a command prompt).  The same registry key/parameter in Server 2003 and 2003 R2 is time.windows.com,0x1 according to technet.microsoft.com/.../cc779560(v=ws.10).aspx. See www.bytefusion.com/.../3_3modesofoperation.htm for explanation of 0x04 flag.

  • Anonymous
    December 17, 2013
    The comment has been removed

  • Anonymous
    July 09, 2014
    The comment has been removed

  • Anonymous
    January 06, 2015
    It's a pity the question about OR'ing the flags has never been answered. The documentation does not state how you can combine them. Anyway in my experience I used 0x1 till now. But since 2015 it's not working anymore. The CISCO router does not answer anymore. Using 0x9 makes it work again.

  • Anonymous
    January 07, 2015
    All of the flags can be OR'd together with the exception of the 0x04 and 0x08 flags - those two are mutually exclusive.