≡ Menu

HP-UX UNIX Configure an NTP Server

Q. How do I configure an NTP (network time protocol) Server under HP-UX UNIX server as my applications rely on the system clock accuracy to get current time / run reports?

A. NTP is used for time synchronization. Many applications such as backup shell/perl scripts, make utility and others depends upon accurate system time.

HP-UX xntpd server configuration

xntpd server (daemon) is used by HP-UX. Open file /etc/rc.config.d/netdaemons:
# vi /etc/rc.config.d/netdaemons
Make sure following variables are defined and XNTPD is set to 1:
export NTPDATE_SERVER='ntp.mycorp.com pool.ntp.org in.pool.ntp.org'
export XNTPD=1
export XNTPD_ARGS=

Save and close the file. Where,

  • NTPDATE_SERVER : space-separated list of timeserver / IPs – If server uses the radio clock / system time, leave the NTPDATE_SERVER blank.
  • XNTPD : set it to 1 to enable NTP
  • XNTPD_ARGS : set options, see man page

Make sure correct timezone is setup in /etc/TIMEZONE file (look for TZ variable):
# vi /etc/TIMEZONE
Save and close the file. Open /etc/ntp.conf file:
vi /etc/ntp.conf
Make sure server are defined:
server unix-box-ntp
server delhi-ntp
peer delhi-noc-ntp
driftfile /etc/ntp.drift

Close and save the file. Where,

  • server : ntp server used (poll) to obtain time
  • peer : a peer relationship with another ntp server
  • driftfile : track local clock time (drift of the local clock)

Start HP-UX ntp service:
# /sbin/init.d/xntpd start
# /sbin/init.d/xntpd stop <-- stop ntp service

Verify that everything is working fine:
# ntpq -p
Watch out log file /var/adm/syslog/syslog.log for errors:
# tail -f /var/adm/syslog/syslog.log
Make sure xntpd is running:
# ps -ef | grep xntpd

SAM - GUI Admin Tool

=> SAM can also be used to configure NTP service under HP-UX, just start SAM and open time window.

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 9 comments… add one }
  • steve hargreaves May 5, 2009, 11:12 am

    What does it mean if the NTPDATE_SERVER=”″ ?

    • nixCraft May 5, 2009, 12:25 pm

      Invalid NTP server address. Something is wrong with your configuration. Check out log files and make sure all updates are applied to HP-UX.

  • Paul Leong August 14, 2009, 8:08 am


    if I specify my NTPDATE_SERVER=’′ in the netconfig

    in the /etc/ntp.conf for servers do I specify the above IP addresses also?
    etc …

    sorry I’m quite new to ntp

  • Anonymous April 5, 2010, 10:11 am

    Hi Vivek

    Thanks for posting this article for hp-ux I was searching this type of configuration steps but could u tell me which version of HP-UX NTP configuration steps you have posted as I have HP-UX version 11.31 and I ‘m not able to see it’s daemon file in /sbin/init.d/ contrary it is available in /sbin as /sbin/xntpd.


    • Ashish December 21, 2012, 11:25 am

      as per my knowledge non of the deamon file is there in the /sbin/init.d file. either they will have separate directory or inside initd.

  • Ajay Rajput August 18, 2010, 9:24 am

    I have followed the above procedure and i was able to synchronize my HP-UX PC to NTP server. But, after it was once synchronized, i have to give the start command again to synchronize the PC.
    Can you advice me that what is the procedure to keep the PC continously synchronized to NTP server without giving repeated xntpd start commands.

    • Ashish December 21, 2012, 11:28 am

      hi… first of of please tell me haw u have installed hp ux in your pc .. becoze i also want the same….. becoz i per my knowledge hp ux is itanium based os and non of the pc do have that think……

      if am wrong plz correct me..

  • Antti July 21, 2011, 10:37 am

    Dear Ajay,

    I’m having the exactly same issue as you: it only syncs during the start up. The process stays alive forever but syncs only once.

    Did you ever find a solution?


  • prasad July 5, 2012, 11:48 am

    what if i disable the time service in hpux 11iv3? Does it effect the ntp service

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , , , , , , , , ,