Preface a time error occurred on a self-managed Ubuntu server, which caused a problem in the display time of mail sending, here, we will take the time to record the process of building an ntp server. The Network Time Protocol (NetworkTimeProcotol) aims to transmit unified and standard time on the Internet. The specific implementation scheme is to specify several clock source websites on the network to provide time service for users, and these websites should be able to compare with each other to improve accuracy. NTP is
Preface
A time error occurred on a self-managed Ubuntu server, which caused a problem in the display time of email sending. Therefore, it is difficult to think about how to set up an ntp server.
Introduction
Network Time Procotol (NTP) is used to transmit unified and standard Time on the Internet. The specific implementation scheme is to specify several clock source websites on the network to provide time service for users, and these websites should be able to compare with each other to improve accuracy.
NTP is a complex synchronization time protocol that spans a wide area network or a LAN. It generally provides millisecond-level precision. RFC2030 describes SNTP (Simple Network Time Protocol) for hosts that do not require complete NTP for complexity. It is a subset of NTP. Generally, several hosts on the LAN synchronize the clock with other NTP hosts over the Internet, and then provide the time synchronization service to other clients in the LAN.
The NTP protocol is a high-level protocol of the OSI reference model. It complies with the UDP transmission protocol format and has a dedicated port of 123.
Over time, computer clock tends to drift. Network Time Protocol (NTP) is a way to ensure that your clock remains accurate. It provides a time synchronization mechanism between routers, switches, workstation and servers. NTP Server is often used in IT system environments with time synchronization requirements.
Server Configuration
Install
Sudo apt-get install ntp
Configuration
Configuration File Location
Sudo/etc/ntp. conf
Configuration method
The upper-layer NTP server is set using the server. The upper-layer NTP server is set as follows:
Server [ip or hostname] [PREFER]
Parameter description:
Ip or hostname: ip address or domain name of the ntp server
Prefer: indicates the host with priority.
Driftfile: record time difference. Because the preset NTP Server's Time calculation is based on the BIOS chip fluctuation cycle frequency, but this value is different from the upper-layer Time Server. So the NTP daemon will automatically calculate the frequency of our host and the upper-layer Time Server, and record the error of the two frequencies, the recorded file is the complete file name followed by driftfile.
Common time servers
Http://www.pool.ntp.org/zone/cn
Configuration File example