What is The Use of NTP Server and How to Configure This Server?

NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You’re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the correct time.

you can open up a terminal window and install ntp with one of the following commands

Code:
apt-get install ntp
yum install ntp
urpmi ntp

One of the above commands will install the ntp daemon and the configuration file /etc/ntp.conf.

Configuration:
The section of the ntp.conf that you will want to take a look at is the server section. Each line in this section is set up like so:

server IP_ADDRESS OPTION(S)

Where IP_ADDRESS is the actual address of the server you want to use and OPTION(S) is/are the option(s) you want to use.

There are two options that you might want to use for every server. These are:

iburst: This option is used when the configured server is unreachable. When your machine can not contact its NTP server it will send out bursts of eight packets (instead of just one).

dynamic: This option allows a server to be configured even if the server is not reachable during configuration. This option assumes that at some point the server will be reachable.

If you look at my /etc/ntp.conf file you will see the following in the server section:

server 0.debian.pool.ntp.org iburst dynamic
server 1.debian.pool.ntp.org iburst dynamic
server 2.debian.pool.ntp.org iburst dynamic
server 3.debian.pool.ntp.org iburst dynamic

If you are not sure what servers to use visit the official NTP organization NTP.org to find a list of trusted servers.

Starting the Daemon

Once you have everything up and running go back to the root terminal and issue the command:

Code:
/etc/init.d/ntp start

or

/etc/rc.d/init.d/ntp start

which will start the ntp daemon. NTP will now slowly start to adjust the time on your server.