Because of the development of distributed systems, the accuracy of clock synchronization has become a key factor affecting the performance of distributed systems. The IEEE1588 precise clock synchronization protocol provides a synchronization technology based on network data packets. According to the content of the protocol, this paper designs the message sending and receiving process at the application layer. In addition, depending on the Linux kernel, the slave clock time is adjusted. The results show that the entire clock synchronization system can be applied to distributed systems that have certain requirements on clock accuracy.