Ntpd en ntpq are pretty dumb as it uses DNS for nothing

Hi all,

I noticed that if the PTR record isn’t set or different (happens a lot) the outcome of ntpq -p is mangled and pretty dumb:

root@sprintweb:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*77.109.90.72 (h .PPS.            1 u   36   64  377   14.728    0.242   0.477

This is not very good as the entry in the config for server is ntp1.heppen.be, it has no clue an just reports the IP.
How stupid is that?

Now it you edit your /etc/hosts file and add e.g. this in my case:

77.109.90.72 ntp1.heppen.be

Then the output is this:

root@sprintweb:~# ntpq -p 
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ntp1.heppen.be  .PPS.            1 u   60   64  377   14.728    0.242   0.686

Probably works the same for Chrony as well as it reads the PTR but reports it instead of the IP.
You can make it say anything you want :slight_smile:

This way you can avoid just IP’s if the PTR can’t be set.
Hopefully somebody will alter the sources to allow you to set the hostname that should be listed insted of just an IP.

If you run dual-stack, you need to give both IP4 and IP6 lines, else it probably doesn’t resolve on both the way you want.

Bas.