NTPTRACE(1)

πŸ’… ntptrace(1) β€” the NTPsec one, bestie

okay so picture this: you're in the terminal, you type man ntptrace, and boom β€” you're reading ntptrace(1) from the NTPsec gang. that's the manual page we're doing today and it's lowkey iconic. let's get into it 🫢


✨ NAME ✨

ntptrace β€” trace peers of an NTP server πŸ”


🌸 SYNOPSIS 🌸

ntptrace [-V | --version] [-n |--numeric]
    [-m number | --max-hosts=number]
    [-r host | --host=remote]
    hostname

that's the whole vibe check right there. no cap ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so ntptrace is a python script, right? and what it does is it uses the ntpq utility program to follow the chain of NTP servers, starting from a host you give it, and walking all the way back to the primary time source. it's giving ancestry.com but for time servers πŸ‘‘

here's the thing though β€” for ntptrace to actually work properly, every single one of those servers has to implement the NTP Control and Monitoring Protocol as specified in RFC 1305, and it has to enable NTP Mode 6 control packets. nowadays it's totally usual for public timeservers to disable Mode 6 queries, so ngl this script is unlikely to be very useful unless you've got a collection of specially-configured timeservers on your LAN. sad but true 😭

if you give it no arguments, ntptrace starts with localhost. here's what the output looks like, and yes it ate:

% ntptrace
localhost: stratum 4, offset 0.0019529, synch distance 0.144135
server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784
usndh.edu: stratum 1, offset 0.0019298, synch distance 0.011993, refid 'GPS'

so on each line, the fields go left to right like this:

  • the host name
  • the host stratum
  • the time offset between that host and the local host β€” and this is measured by ntptrace itself, which is literally why it's not always zero for "localhost" πŸ’€
  • the host synchronization distance
  • and, only for stratum-1 servers, the reference clock ID

all times are given in seconds. and just so we're clear on the lore: the stratum is the server hop count to the primary source, while the synchronization distance is the estimated error relative to the primary source. these terms are precisely defined in RFC 1305 β€” go read it if you want the full backstory πŸ“š


πŸŽ€ OPTIONS πŸŽ€

  • -n, --numeric β€” print IP addresses instead of hostnames. basically output hosts as dotted-quad numeric format rather than converting to the canonical host names. numbers only, no name-dropping πŸ’…
  • -m number, --max-hosts=number β€” maximum number of peers to trace. this option takes an integer number as its argument. the default number for this option is 99. ninety-nine peers, but a bug ain't one πŸ”₯
  • -r string, --host=string β€” trace a single remote host. one host, one mission 🎯
  • -V, --version β€” print the version string and exit. that's it, that's the whole job ✨

⭐ EXIT STATUS ⭐

one of the following exit values will be returned, and yes we're listing them all because we don't skip:

  • 0 (EXIT_SUCCESS) β€” successful program execution. slay πŸ’–
  • 1 (EXIT_FAILURE) β€” the operation failed or the invocation was not valid. it's giving flop, but respectfully πŸ™ˆ

πŸ’€ reminder bestie: Mode 6 queries are usually off on public timeservers, so don't come for ntptrace when it can't reach them. it's not her fault, fr fr.

and that's the page!! brought to you by NTPsec, dated 2026-10-21 β€” big thank you to the source and version for making this possible, mwah πŸ«ΆπŸ’œ periodt.

πŸ“¦ where this page comes from