Solved

Where does a windows server get the correct time from?

Posted on 2008-10-22
45
469 Views
Last Modified: 2010-04-21
my server time is 5 minutes fast.

i thought i remembered seeing a setting that said i could connect to time.windows.com to up to date time.

however, i cant find that on the server or my workstation.  was this removed by a windows update?

i can manually set the time 5 minutes back on the servers, but within 1 day, i jumps up 5 minutes.

i know that the workstations get the time from the server because if i reboot my computer it displays the same time as the server.

thanks.
0
Comment
Question by:tomdlgns
  • 24
  • 21
45 Comments
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Hi there.

Is this a virtual or a physical machine?

Nevertheless you can set your time source to ntp.org (probably the best time source) using the following commands on a command line:

net time /setsntp:pool.ntp.org

You need to make sure the server has NTP protocol access to the internet on your firewall/proxy.

These commands may also be useful:

net time /querysntp (it checks what's your current time source)

w32tm /resync (it resyncs your clock using the sntp time source)

Hope it helps

Alex


0
 

Author Comment

by:tomdlgns
Comment Utility
C:\>net time /querysntp
The current SNTP value is: time.windows.com,0x1

The command completed successfully.

that is the same thing i got on my server and on my workstation.
0
 

Author Comment

by:tomdlgns
Comment Utility
just tried running this on my server

C:\>w32tm /resync
Sending resync command to local computer...
The computer did not resync because no time data was available.

0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
The command completing successfully doesn't always means it's getting time from the time source.

On your workstation it'll say the time source is time.windows.com because that's the default source for all windows computers. The thing is when you join a computer to a windows domain it'll get its time form a domain controller rather than the internet time source. That's why it's so important to have time synced on the domain controllers.

Did you try the w32tm /resync  command  on the server yet?

Did i t work?
0
 

Author Comment

by:tomdlgns
Comment Utility
btw, physical machine, nothing virtual.
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
That may mean your server doesn't have NTP access to the internet. There were times when I only managed to get a successful connection after a few tries.
0
 

Author Comment

by:tomdlgns
Comment Utility
i did, just above your last response.  you were probably typing your response as i was updating the thread.
0
 

Author Comment

by:tomdlgns
Comment Utility
@

That may mean your server doesn't have NTP access to the internet. There were times when I only managed to get a successful connection after a few tries.

do i need to open up a port on my firewall?

i will try the command a few more times.
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Did you try changing the time source to pool.ntp.org?
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Your firewall should allow all domain controllers acccess to UDP port 123 to the internet (it's the NTP protocol port)
0
 

Author Comment

by:tomdlgns
Comment Utility
yes, it is using pool.ntp.org.
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
this may also help

http://support.microsoft.com/?kbid=830092

make sure your w32time DLLs are the same version as the ones mentioned there
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Or more recent hehe
0
 

Author Comment

by:tomdlgns
Comment Utility
i am going to compare the DLL files, but SP2 is already installed on both of my servers.

0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
It should be cool then
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Did you manage to open that port on the firewall?
0
 

Author Comment

by:tomdlgns
Comment Utility
@

Did you manage to open that port on the firewall?

no, i am going to try that now.

also, my XP machine on a domain says that it is still getting the time from time.windows.com

i thought you said once the computer is on a domain, it should grab time from the DC?

0
 

Author Comment

by:tomdlgns
Comment Utility
it says to use port 80, port 80 is an open port...?
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
It does even though when you run the /querysntp command it'll show the external time source. The DC source overrides that one.
0
 

Author Comment

by:tomdlgns
Comment Utility
ok

now, which port should i open?
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Where does it say to use port 80?
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
it's definitely UDP port 123
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
outbound only...no need to open inbound
0
 

Author Comment

by:tomdlgns
Comment Utility
ok
thanks, i am going to open that port and point it to my file server.

should i also point it to my exchange server?

they are both DCs
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
probably best, yes
0
 

Author Comment

by:tomdlgns
Comment Utility
still getting the same error.

although, my windows xp machine says it is completing successfully, and this was before i even opened up the udp 123 port.
0
 
LVL 1

Accepted Solution

by:
JayPeeAS earned 50 total points
Comment Utility
can you resolve pool.ntp.org on your server?

If not you need to sort out DNS issues.

If so try the following:

net stop w32time

w32tm /unregister

w32tm /register

w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL /reliable:YES (you can also try time.windows.com just to be sure nothing's wrong with the time source)

net start w32tm

w32tm /config /update

w32tm /resync /rediscover

Let me know how it goes

w32tm /config
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
IP for pool.ntp.org is 195.22.25.130 in case you wanna try with the IP address
0
 

Author Comment

by:tomdlgns
Comment Utility

C:\Documents and Settings\Administrator>cd..

C:\Documents and Settings>cd..

C:\>ping pool.ntp.org

Pinging pool.ntp.org [74.86.97.132] with 32 bytes of data:

Reply from 74.86.97.132: bytes=32 time=45ms TTL=55
Reply from 74.86.97.132: bytes=32 time=52ms TTL=55
Reply from 74.86.97.132: bytes=32 time=47ms TTL=55
Reply from 74.86.97.132: bytes=32 time=53ms TTL=55


C:\>net stop w32time
The Windows Time service is stopping.
The Windows Time service was stopped successfully.


C:\>w32tm/unregister
W32Time successfully registered.

C:\>w32tm/register
W32Time successfully registered.

C:\>w32tm/config/manualpeerlist:pool.ntp.org/syncfromflags:MANUAL/reliableYES
The command /config/manualpeerlist:pool.ntp.org/syncfromflags:MANUAL is unknown.


0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
There are spaces in that commmand

Try it like this

w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
I'm getting problems syncing with pool.ntp.org on my end as well. Try all that but using another time source such as time.windows.com or time.nist.gov
0
 

Author Comment

by:tomdlgns
Comment Utility
net start w32tm

The service name is invalid.
0
 

Author Comment

by:tomdlgns
Comment Utility
ill try net start w32time
0
 

Author Comment

by:tomdlgns
Comment Utility
ok, it took my time from 330 to 325.

hopefully it doesn't jump ahead 5 min again.
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
If it does you just need to tell it to poll the time source in a shorter period of time

You can change the following reg key for that

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

the default is 900 seconds (15 minutes). If that isn't short enough you can set it to do it in a shorter period of time.

0
 

Author Comment

by:tomdlgns
Comment Utility
so by default, i will know in 15 minutes if this worked or not, correct?
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Not exactly. You said you'd only notice it after 1 day. This means the internal clock processor takes a while to take the internal clock forward. 15 minutes should be enough to keep the time right. Hopefully you won't notice the clock going forward again.
0
 

Author Comment

by:tomdlgns
Comment Utility
as of right now, the time is still the same.

so back to the last post, is it trying to sync with time.windows.com every 15 minutes?
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
That's it. Is the time still correct?
0
 

Author Comment

by:tomdlgns
Comment Utility
yeah, since i did that, the time hasn't jumped 5 min ahead.
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Cool potatoes :)))
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
What you can do to test is change the time and move it 2 or 3 minutes ahead or behind and wait for it to get back to the correct time automatically. If it does within 15 minutes then it's all working
0
 

Author Closing Comment

by:tomdlgns
Comment Utility
net start w32tm needs to be changed to net start w32time
0
 
LVL 1

Expert Comment

by:JayPeeAS
Comment Utility
Glad it worked out for you. Thanks for the points :))
0
 

Author Comment

by:tomdlgns
Comment Utility
thanks for all of your help.  this has been bugging a few users on the network for a while.  i really don't blame them, though.  

we all have cell phones, office phones, PCs, some have watches, and pretty much everyone with an office has a wall clock.

i guarantee that if i were to take the clock with the slowest time and then take the clock with the fastest time, there is probably a difference of 20 minutes.  it is nice to see that some of the clocks are accurate now.

0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now