Setting up a standalone NTP server on Ubuntu
I want to setup a standalone NTP server on Ubuntu.
The problem is all the tutorials i see on the internet are about how to make the server to synchronize with another time server on the internet and then broadcast the time in my network.
What I want is the server I'm setting up to use its own system clock and broadcast it to the network, and not having to synchronize with an internet time server before that. How can I achieve that?
Also, on another note, which command can I run with ntpd
or ntpdc
to check that my server and clients are running the daemon correctly?
Solution 1:
You can comment out those pool servers list under /etc/ntp.conf
and specificity your own server. Let me give the full step:
Server side
First, disable the ntpdate service:
sudo update-rc.d -f ntpdate remove
Install NTP
sudo apt-get install ntp
Open and edit the ntp configuration file:
/etc/ntp.conf
Comment out those pool servers and specifiy your own server address e.g:
server 192.168.20.1
Now, restart the ntp service
sudo service ntp restart
Clients side
Install NTP
sudo apt-get install ntp
And then edit the configuration file /etc/ntp.conf
Finally specify your own server address:
server 192.168.20.1
If you have a DNS entry for the NTP server you can use like:
server et.ntp.org
Restart
sudo service ntp restart
You need to see this for your last question:
How to check if NTPD updates Linux machine's time successfully
Solution 2:
This is an old question, but there is no answer here, so, I would provide an answer for other people, struggling with this problem, if you've already solved it.
You might want to use (on the server):
server 127.127.1.0
fudge 127.127.1.0 stratum 8
where stratum #number is some reasonably low number, which means, that the server can be trusted for the time information, that it provides.