Check NTP server working or not, Check NTP server Date and Time – Windows, Linux

Windows

1 Use Win + R to open run Window

Microsoft Windows - Run window
Microsoft Windows – Run window

2 Type cmd, then hit Enter key

Microsoft Windows - Run window - cmd.exe
Microsoft Windows – Run window – cmd.exe

The command we use is in following format:

w32tm /stripchart /computer:domainnameORipaddress /dataonly /samples:5

3 Enter following command to test “time.windows.com”

w32tm /stripchart /computer:time.windows.com /dataonly /samples:5
Microsoft Windows - CMD -   w32tm /stripchart /computer:time.windows.com /dataonly /samples:5 output
Microsoft Windows – CMD – w32tm /stripchart /computer:time.windows.com /dataonly /samples:5 output

Bonus: Other commands

1 Show the current time zone settings:

w32tm /tz

2 List external NTP servers (peers)

w32tm /query /peers
Microsoft Windows - CMD -  w32tm /query /peers output
Microsoft Windows – CMD – w32tm /query /peers output

Note! If you have encountered this error: “The following error occurred: The service has not been started. (0x80070426)”, you need to start the “Windows Time” service, you can start a elevated cmd or PowerShell by using Win + X key combination then select “Command Prompt (Admin)” or “Windows PowerShell (Admin)” then type “sc start W32Time” to start the Windows Time service or using Run window and type “services.msc” then find “Windows Time” service and start it.

3 Restore Windows Time service settings to default

C:\>net stop w32time
C:\>w32tm /unregister
C:\>w32tm /register
C:\>net start w32time

4 Re-sync Time

Resynchronize the clock as soon as possible, disregarding all accumulated error statistics. If no computer is specified, the local computer will resynchronize. The command will wait for resynchronization unless the /nowait switch is used.

w32tm /resync

5 Redirect the network configuration and Re-sync time

Force redetection of network resource before resynchronization.

w32tm /resync /rediscover
Microsoft Windows - PowerShell - w32tm /resync /rediscover output
Microsoft Windows – PowerShell – w32tm /resync /rediscover output

6 Check current NTP configuration

Show Information:

w32tm /query /status
Microsoft Windows - PowerShell -  w32tm /query /status  output
Microsoft Windows – PowerShell – w32tm /query /status output

Show Configuration:

w32tm /query /configuration
Microsoft Windows - PowerShell -  w32tm /query /configuration  output
Microsoft Windows – PowerShell – w32tm /query /configuration output

Linux

1 ntpdate -q domainnameORipaddress

ntpdate -q time.windows.com
Linux - Terminal - ntpdate -q time.windows.com output
Linux – Terminal – ntpdate -q time.windows.com output

2 ntpq -p domainnameORipaddress

ntpq -p 192.168.1.1

Leave a Reply

Your email address will not be published. Required fields are marked *