Time is the most important value in our life, philosophically speaking. Since the starting of our life, we’ve been taught that time is money. That’s why it’s really important to maintain the time in our life. That’s even a burning truth to the systems where even the slightest bit of delay in the system can cause serious and troublesome issues in lots of places. The best solution for this problem is NTP.
That’s what I faced several days ago when the computer time went haywire. Almost all the major sites were blocked in my device, thinking that I may be a hacker or some intruder. Thankfully, I synced with the NTP and fixed the issue. It’s always a good idea to sync your system with any NTP for keeping your PC’s time always up-to-date.
What is NTP?
NTP stands for Network Time Protocol. It’s a networking protocol that’s being used widely for syncing clocks between computer systems where system latency is a big factor. It’s also quite useful for keeping your system’s time up-to-date. In fact, it’s one of the oldest network protocols still in use.
Syncing your Linux with NTP
In most of the Linux systems, it’s done automatically. However, your system is prone to go haywire time to time. Let’s fix the system once and for all.
Installing NTPd
It comes pre-installed in lots of Linux distros, but just to make sure that it’s present in your system.
- Ubuntu
sudo apt install ntp
- Debian
sudo apt-get install ntp
- Fedora
sudo dnf install ntp
- OpenSUSE
sudo zypper install ntp
- Arch Linux
sudo pacman -S ntp
Configuring the NTP server
The NTPd program comes up with preset NTP servers in the configuration file. Those are enough for average users, but I recommend to switch to better servers like Google NTP.
For adding the Google NTP server in the system, run this command:
sudo nano /etc/ntp.conf
Now, add these lines in the file:
server time.google.com iburst server time2.google.com iburst server time3.google.com iburst
Setting time zone
Before NTPd starts syncing with the time server, it needs to know your time zone. For setting that up, start a terminal and run this command:
tzselect
The wizard will walk you through setting up your time zone.
Starting NTPd
Open a terminal and run the following commands:
sudo systemctl start ntp.service sudo systemctl enable ntp.service
Enjoy the super accurate timing of your PC!
Love Linux? Then try out the latest features of Ubuntu 18.04 LTS!