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 (18)

  1. Frank says:

    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!

  2. Ryan Sizemore says:

    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.

  3. Frank says:

    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?

  4. Ryan Sizemore says:

    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.

  5. brorymes says:

    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?

  6. Gary says:

    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,

  7. Ryan Sizemore says:

    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

  8. Gus says:

    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!!!

  9. Ryan Sizemore says:

    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

  10. Donno Cole says:

    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!

  11. Ryan Sizemore says:

    Hi Donno,

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

  12. HimeshG73 says:

    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.

  13. mdpugh says:

    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.

  14. mdpugh says:

    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 http://www.bytefusion.com/…/3_3modesofoperation.htm for explanation of 0x04 flag.

  15. AndyShintonMS says:

    I have found the following article explains some of the aspects of the Windows time service without getting too technical:

    http://www.timetools.co.uk/…/configuring-a-windows-time-server

    As technet.microsoft.com/…/cc773013(v=ws.10).aspx explains, the W32Time service is not a full-featured NTP solution that meets time-sensitive application needs. It may be wise to consider a windows port of the full-blown network time protocol application.

  16. Taho.C says:

    Guys take a look at this 3rd party ntp client tool nts.softros.com/client.html it can be easy deployed via GPO and configured via company's DNS server using additional zone/host (timeserver.nts) that points to any NTP server inside or outside the LAN or configured via administrative templates

  17. lafrecciablu says:

    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.

  18. All of the flags can be OR'd together with the exception of the 0x04 and 0x08 flags – those two are mutually exclusive.