How to sync your clock on Solaris

Posted in OpenSolaris, Solaris & OpenSolaris on May 29th, 2007 by Michal Bielicki

So you have your squeaky fresh solaris or solaris express install and the clock is all wrong. You want it to be correct allways, perfectly synced to the internet. I suggest you use the services of pool.ntp.org. Pool.ntp.org is a pool of servers that are publicly available for Network TIme Protocol requests on the internet.

So lets go for it

Create the file /etc/inet/ntp.conf and add the following to it:

driftfile /var/ntp/ntp.drift

server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

Now activate your ntp daemon:

svcadm enable ntp

et voila, your clock is allways up to date.

You can check your time differences with:

ntpq -p

which should give you an output like:

bash-3.00# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
admin.curacao.b ntp1.linx.net 2 u 44 64 1 25.57 1.529 15875.0
static.80.254.4 ns.tele.dk 2 u 44 64 1 37.51 -3.456 15875.0
ntp1.adviseo.ne clock.sjc.he.ne 2 u 44 64 1 25.42 -3.154 15875.0
bash-3.00#

Powered by ScribeFire.

Tags: , , , ,