ntpd/ntpq tangle

James Browning jamesb192 at jamesb192.com
Fri Jul 10 18:07:32 UTC 2026


> On 07/10/2026 2:54 AM PDT Hal Murray <halmurray at sonic.net> wrote:
> 
> Can you easily setup a server with my fixes so you can work on ntpq? Or
> should I setup one you can poke over the net?

I have a running copy of NTPsec with some changes. This interacts
with 000dfdcef, which I massively underdocumented. It complicated
the host name/address mode handling, abbreviated below.

```console
ntpq> help hostnames
function: specify whether hostnames or net numbers are printed
usage: hostnames [yes|no|hostname|hostnum]
ntpq> hostnames yes
resolved hostnames being shown
supplied hostnames not being shown
ntpq> peers
     remote           refid      st t when poll reach   delay   offset   jitter
===============================================================================
 tunnel789905-pt .XFAC.          16 u    - 1024    0   0.0000   0.0000   0.0000
 DNSFAIL:(sockto .POOL.          16 p    -  256    0   0.0000   0.0000   0.0000
+dreamstation.sy 204.9.54.119     2 u  593 1024  377  95.2745  23.0553   9.0987
 DNSFAIL:(sockto .DNS.           16 u    -  68m    0   0.0000   0.0000   0.0000
ntpq> hostnames no
resolved hostnames not being shown
supplied hostnames not being shown
ntpq> peers
     remote           refid      st t when poll reach   delay   offset   jitter
===============================================================================
 2001:470:a:b4:: .XFAC.          16 u    - 1024    0   0.0000   0.0000   0.0000
 (socktoa unknow .POOL.          16 p    -  256    0   0.0000   0.0000   0.0000
+67.215.249.229  204.9.54.119     2 u  600 1024  377  95.2745  23.0553   9.0987
 (socktoa unknow .DNS.           16 u    -  68m    0   0.0000   0.0000   0.0000
ntpq> hostnames hostname
resolved hostnames being shown
supplied hostnames being shown
ntpq> peers
     remote           refid      st t when poll reach   delay   offset   jitter
===============================================================================
 dell-2018.james .XFAC.          16 u    - 1024    0   0.0000   0.0000   0.0000
 2.pool.ntp.org  .POOL.          16 p    -  256    0   0.0000   0.0000   0.0000
+dreamstation.sy 204.9.54.119     2 u  630 1024  377  95.2745  23.0553   9.0987
 beerme.jameb192 .DNS.           16 u    -  68m    0   0.0000   0.0000   0.0000
ntpq> hostnames hostnum
resolved hostnames not being shown
supplied hostnames being shown
ntpq> peers
     remote           refid      st t when poll reach   delay   offset   jitter
===============================================================================
 dell-2018.james .XFAC.          16 u    - 1024    0   0.0000   0.0000   0.0000
 2.pool.ntp.org  .POOL.          16 p    -  256    0   0.0000   0.0000   0.0000
+67.215.249.229  204.9.54.119     2 u  644 1024  377  95.2745  23.0553   9.0987
 beerme.jameb192 .DNS.           16 u    -  68m    0   0.0000   0.0000   0.0000
```

I don't suppose It'd be reasonable to change the default "hostnames
hostname" and change -n to "hostname hostnum"?  With corresponding
shifts of -s and -S to cover the "hostnames" values, yes and no,
respectively.

Altenatively, I have a couple of 2-line insert patches that:
- changes the t(ype) field to an arbitrary charaacter when the
  srcadr from mode 6 starts with '('
- changes the default displayed name to an arbitrary string


More information about the devel mailing list