Tag Archives: ntpdate

[Solved] Centos8 Install ntpdate Error: No match for argument: ntpdate

In the centos8 system, the original time synchronization service NTP/ntpdate service is no longer available. Install it using Yum and the prompt no longer exists

Previous versions: Yum install – y NTP

centos8:yum -y install chrony

At this time, the temporary synchronization time method is: chronyd – Q ‘server NTP ntsc. ac.cn iburst’

Running ntpdate reports an error: temporary failure in name resolution

I. problem error reporting:

Suddenly, I found that the time of a machine was a few minutes slow. Before, ntpd service was not set up. At present, ntpdate plus timing task is used for time synchronization. The following errors are reported when directly executing ntpdate:

# ntpdate cn.pool.ntp.org
Exiting, name server cannot be used: Temporary failure in name resolution (-3) 3 Sep 15:46:46 ntpdate[13742]: name server cannot be used: Temporary failure in name resolution (-3)

II. Cause of problem:

Generally, the error is temporary failure in name resolution, which cannot be resolved, and the Ping test is also unsuccessful. Therefore, it is judged that there is a problem with the resolv.conf file

# ping www.baidu.com
ping: unknown host www.baidu.com

III. solution:

You can fill in the correct DNS address according to the network provider

# cat /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8

# ntpdate cn.pool.ntp.org
 3 Sep 17:54:33 ntpdate[17314]: step time server 5.103.139.163 offset 995.587830 sec

ntpdateUpdate system time venue Can’t find host ntp1.aliyun.com: Servname not supported for ai_socktype (-8)

Can’t find host ntp1.aliyun.com: servname not supported for AI_ socktype (-8)

Error reported:

[root@web01 ~]# ntpdate ntp1.aliyun.com

Error resolving ntp1.aliyun.com: Servname not supported for ai_socktype (-8)

11 Feb 20:58:03 ntpdate[3318]: Can't find host ntp1.aliyun.com: Servname not supported for ai_socktype (-8)

11 Feb 20:58:03 ntpdate[3318]: no servers can be used, exiting

Reason: the domain name resolution error is caused by the change or nonexistence of the/etc/services file

[root@web01 etc]# ls -l servic*

-rw-r--r--. 1 root root  10240 Feb 11 02:27 services

-rw-r--r--  1 root root 641020 Feb 11 02:22 services.bak  Long format comparison reveals that the source file has been changed

[root@web01 etc]# mv services /tmp

[root@web01 etc]# ls -l servic*

-rw-r--r-- 1 root root 641020 Feb 11 02:22 services.bak

[root@web01 etc]# mv services.bak  services

[root@web01 etc]# ls -l servic*

-rw-r--r-- 1 root root 641020 Feb 11 02:22 services

[root@web01 etc]# ntpdate ntp1.aliyun.com

12 Feb 17:00:54 ntpdate[3363]: step time server 182.92.12.11 offset 71111.641937 sec