Link to home
Start Free TrialLog in
Avatar of tomdlgns
tomdlgnsFlag for United States of America

asked on

Where does a windows server get the correct time from?

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.
Avatar of JayPeeAS
JayPeeAS

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


Avatar of tomdlgns

ASKER

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

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?
btw, physical machine, nothing virtual.
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.
i did, just above your last response.  you were probably typing your response as i was updating the thread.
@

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.
Did you try changing the time source to pool.ntp.org?
Your firewall should allow all domain controllers acccess to UDP port 123 to the internet (it's the NTP protocol port)
yes, it is using pool.ntp.org.
this may also help

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

make sure your w32time DLLs are the same version as the ones mentioned there
Or more recent hehe
i am going to compare the DLL files, but SP2 is already installed on both of my servers.

It should be cool then
Did you manage to open that port on the firewall?
@

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?

it says to use port 80, port 80 is an open port...?
It does even though when you run the /querysntp command it'll show the external time source. The DC source overrides that one.
ok

now, which port should i open?
Where does it say to use port 80?
it's definitely UDP port 123
outbound only...no need to open inbound
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
probably best, yes
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.
ASKER CERTIFIED SOLUTION
Avatar of JayPeeAS
JayPeeAS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
IP for pool.ntp.org is 195.22.25.130 in case you wanna try with the IP address

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.


There are spaces in that commmand

Try it like this

w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL
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
net start w32tm

The service name is invalid.
ill try net start w32time
ok, it took my time from 330 to 325.

hopefully it doesn't jump ahead 5 min again.
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.

so by default, i will know in 15 minutes if this worked or not, correct?
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.
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?
That's it. Is the time still correct?
yeah, since i did that, the time hasn't jumped 5 min ahead.
Cool potatoes :)))
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
net start w32tm needs to be changed to net start w32time
Glad it worked out for you. Thanks for the points :))
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.