NTP Server

So you want to setup your own NTP server? Setting one up in Ubuntu 12.04 is really easy.

sudo aptitude install ntp

Once it has been installed you can modify its configuration file /etc/ntp.conf. The default settings are pretty sane and you may want to only change the NTP servers it uses. Then start the service if it’s not already started.

sudo service ntp start

But be aware of some issues.

The first one is “stratum”. NTP servers work in a hierarchy and stratum indicates the level in which your server lies. Mostly any stratum 4 or higher is ignored and anything 3 or lower is used. To find out the stratum of your server run the following command.

ntptrace

If you have a high stratum, especially stratum 16, you need to do two things:

1. Use NTP servers with lower stratum as your source in /etc/ntp.conf file. These are servers closest to your geographical location.
2. After starting NTP service wait for about 15 minutes and then run ntptrace again to see if the server’s time has stabilized.

Performing these two actions will go a long way in ensuring that you don’t get the “no server suitable for synchronization” error when using your new NTP server.

Another useful command is:

ntpq -p

I also recently found out that ntpdate is deprecated and has been replaced with sntp.

Hat tip to ntptrace returns stratum 16, ntpq -p shows sync with stratum 2 server for clearing up lots of stuff. Other honorable mentions: NTP Troubleshooting; Network Time Protocol (NTP) Server and Clients Setup in Ubuntu

Comments are closed.