How To Set Time Using NTP In Solaris

What is NTP?

NTP is stand for Network Time Protocol. It is used for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP on port 123 as its transport layer.

Keeping the date/time synchronized throughout all computers / servers is really necessary. Solaris already comes with the ntp daemon, called "xntpd".

  • Check whether NTP daemon is already running / not

root@server:~# svcs -a | grep ntp
disabled       May_11   svc:/network/ntp:default

  • If its not running, please create/edit the config file in /etc/inet/ntp.conf. The contents should be similar as below.

root@server:~# cat /etc/inet/ntp.conf
# ident "@(#)ntp.server 1.7     03/01/17 SMI"
#
# Copyright 1996-2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
 
# List your ntp server address here. You may set one of the server as preferred.
server 0.pool.ntp.org prefer
server 1.pool.ntp.org
server 2.pool.ntp.org
server pool.ntp.org
 
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
 
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable

  • Now start the NTP daemon

root@server:~# svcadm enable ntp

  • Check for any error message

root@server:~# tail -f /var/adm/messages

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <b> <i> <p> <br> <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.