Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

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.
0
tomdlgns
Asked:
tomdlgns
  • 24
  • 21
1 Solution
 
JayPeeASCommented:
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
 
tomdlgnsAuthor Commented:
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
 
tomdlgnsAuthor Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

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
 
JayPeeASCommented:
Did you try changing the time source to pool.ntp.org?
0
 
JayPeeASCommented:
Your firewall should allow all domain controllers acccess to UDP port 123 to the internet (it's the NTP protocol port)
0
 
tomdlgnsAuthor Commented:
yes, it is using pool.ntp.org.
0
 
JayPeeASCommented:
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
 
JayPeeASCommented:
Or more recent hehe
0
 
tomdlgnsAuthor Commented:
i am going to compare the DLL files, but SP2 is already installed on both of my servers.

0
 
JayPeeASCommented:
It should be cool then
0
 
JayPeeASCommented:
Did you manage to open that port on the firewall?
0
 
tomdlgnsAuthor Commented:
@

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
 
tomdlgnsAuthor Commented:
it says to use port 80, port 80 is an open port...?
0
 
JayPeeASCommented:
It does even though when you run the /querysntp command it'll show the external time source. The DC source overrides that one.
0
 
tomdlgnsAuthor Commented:
ok

now, which port should i open?
0
 
JayPeeASCommented:
Where does it say to use port 80?
0
 
JayPeeASCommented:
it's definitely UDP port 123
0
 
JayPeeASCommented:
outbound only...no need to open inbound
0
 
tomdlgnsAuthor Commented:
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
 
JayPeeASCommented:
probably best, yes
0
 
tomdlgnsAuthor Commented:
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
 
JayPeeASCommented:
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
 
JayPeeASCommented:
IP for pool.ntp.org is 195.22.25.130 in case you wanna try with the IP address
0
 
tomdlgnsAuthor Commented:

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
 
JayPeeASCommented:
There are spaces in that commmand

Try it like this

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

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

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 24
  • 21
Tackle projects and never again get stuck behind a technical roadblock.
Join Now