ntpq -pn shows DNS names sometimes
Dear All,
I have seen that ntpq -pn doesn't show the IP addresses. Instead of doing so you can watch the domain name. I figured out this happens in the INIT phase for a server when reach is still zero.
This will break some scripts. If using option -n one should count on the fact an IP address will be returned.
Also the man page says for option n "Output ALL host addresses in numeric format .... ". It doesn't say when but I think we could assume "always".
Maybe we should complete the man page or add a new option
-n numeric output, no DNS names
-s sometime numeric, sometimes DNS
( sorry joking, the last one is not a serious comment, but the issue is a serious one )
Actually this brings me to another topic that's not easy to shell script the output of ntpq -p. Why do we still stick on the fact that our screens can handle 80 character only ? The time when I used a VT100 and later a VT220 are long time over. I assume also for you. For IPv6 the "remote" column is to small. Option -w is a possible solution. But than it wraps into 2 lines. Either making "remote" larger or shifting the rest to the right. For scripting with awk it does matter how many characters a column has.
A new product should have new future oriented options. But I also accept that not all ideas can be implemented immediately.
Sorry for mixing an issue with a feature request.
Kind regards Hans
My environment:
# ntpq -c ver
ntpsec-0.9.7+521 2017-05-02T15:40:36-0700