On my computer, it seems that ntpd() does not resolve DNS names.
In my /etc/ntp.conf file I configured the following NTP pools:
However, ntpd() does not connect to the NTP pools:
When I restart ntpd() I get the follwing entries in /var/log/messages:
Nevertheless, with host() I am able to resolve the DNS names:
Also ntpdate() works fine using the DNS name of the NTP server:
I configured the NTP servers with their IP addresses as obtained by the host() command within /etc/ntp.conf:
Now ntpd() can connect to the IP address of the NTP server:
So, for some strange reason, ntpd is not able to resolve DNS names, while the system is able to do so. Does anyone have a clue how to fix this?
In my /etc/ntp.conf file I configured the following NTP pools:
Code:
pool pool.ntp.org iburst
pool 0.de.pool.ntp.org iburst
pool 1.de.pool.ntp.org iburst
pool 0.freebsd.pool.ntp.org iburst
pool 2.freebsd.pool.ntp.org iburst
However, ntpd() does not connect to the NTP pools:
Code:
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
pool.ntp.org .POOL. 16 p - 64 0 0.000 +0.000 0.000
0.de.pool.ntp.o .POOL. 16 p - 64 0 0.000 +0.000 0.000
1.de.pool.ntp.o .POOL. 16 p - 64 0 0.000 +0.000 0.000
0.freebsd.pool. .POOL. 16 p - 64 0 0.000 +0.000 0.000
2.freebsd.pool. .POOL. 16 p - 64 0 0.000 +0.000 0.000
When I restart ntpd() I get the follwing entries in /var/log/messages:
Code:
Sep 23 11:09:34 ufr-t14 ntpd[43118]: ntpd exiting on signal 15 (Terminated)
Sep 23 11:09:34 ufr-t14 ntpd[32839]: ntpd 4.2.8p16-a (1): Starting
Sep 23 11:09:34 ufr-t14 ntpd[32839]: Command line: /usr/sbin/ntpd -p /var/db/ntp/ntpd.pid -c /etc/ntp.conf -f /var/db/ntp/ntpd.drift
Sep 23 11:09:34 ufr-t14 ntpd[32839]: ----------------------------------------------------
Sep 23 11:09:34 ufr-t14 ntpd[32839]: ntp-4 is maintained by Network Time Foundation,
Sep 23 11:09:34 ufr-t14 ntpd[32839]: Inc. (NTF), a non-profit 501(c)(3) public-benefit
Sep 23 11:09:34 ufr-t14 ntpd[32839]: corporation. Support and training for ntp-4 are
Sep 23 11:09:34 ufr-t14 ntpd[32839]: available at https://www.nwtime.org/support
Sep 23 11:09:34 ufr-t14 ntpd[32839]: ----------------------------------------------------
Sep 23 11:09:34 ufr-t14 ntpd[33817]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): good hash signature
Sep 23 11:09:34 ufr-t14 ntpd[33817]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): loaded, expire=2025-06-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
Sep 23 11:09:35 ufr-t14 ntpd[33817]: error resolving pool pool.ntp.org: Name does not resolve (8)
Sep 23 11:09:36 ufr-t14 ntpd[33817]: error resolving pool 0.de.pool.ntp.org: Name does not resolve (8)
Sep 23 11:09:37 ufr-t14 ntpd[33817]: error resolving pool 1.de.pool.ntp.org: Name does not resolve (8)
Sep 23 11:09:38 ufr-t14 ntpd[33817]: error resolving pool 0.freebsd.pool.ntp.org: Name does not resolve (8)
Sep 23 11:09:39 ufr-t14 ntpd[33817]: error resolving pool 2.freebsd.pool.ntp.org: Name does not resolve (8)
Nevertheless, with host() I am able to resolve the DNS names:
Code:
# host 0.de.pool.ntp.org
0.de.pool.ntp.org has address 109.91.184.21
0.de.pool.ntp.org has address 185.163.116.98
0.de.pool.ntp.org has address 212.132.97.26
0.de.pool.ntp.org has address 185.252.140.125
0.de.pool.ntp.org mail is handled by 0 .
# host 0.freebsd.pool.ntp.org
0.freebsd.pool.ntp.org has address 78.47.56.71
0.freebsd.pool.ntp.org has address 79.133.44.138
0.freebsd.pool.ntp.org has address 5.9.193.27
0.freebsd.pool.ntp.org has address 129.70.132.37
0.freebsd.pool.ntp.org mail is handled by 0 .
Also ntpdate() works fine using the DNS name of the NTP server:
Code:
# service ntpd stop
Stopping ntpd.
Waiting for PIDS: 33817.
# ntpdate 0.freebsd.pool.ntp.org
23 Sep 11:12:37 ntpdate[54455]: adjust time server 79.133.44.138 offset +0.002678 sec
I configured the NTP servers with their IP addresses as obtained by the host() command within /etc/ntp.conf:
Code:
server 78.47.56.71 iburst
server 79.133.44.138 iburst
server 5.9.193.27 iburst
server 129.70.132.37 iburst
Now ntpd() can connect to the IP address of the NTP server:
Code:
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
pool.ntp.org .POOL. 16 p - 64 0 0.000 +0.000 0.000
0.de.pool.ntp.o .POOL. 16 p - 64 0 0.000 +0.000 0.000
1.de.pool.ntp.o .POOL. 16 p - 64 0 0.000 +0.000 0.000
0.freebsd.pool. .POOL. 16 p - 64 0 0.000 +0.000 0.000
2.freebsd.pool. .POOL. 16 p - 64 0 0.000 +0.000 0.000
+node-1.infogral 17.253.14.253 2 u 19 64 1 22.260 -3.309 3.112
*79.133.44.138 .MBGh. 1 u 18 64 1 12.496 -0.596 0.539
+mx.ae9.eu 152.103.15.66 2 u 17 64 1 18.609 +0.057 1.372
-stratum2-4.NTP. 129.70.137.82 2 u 16 64 1 19.725 -0.514 1.422
So, for some strange reason, ntpd is not able to resolve DNS names, while the system is able to do so. Does anyone have a clue how to fix this?