When trying to display numeric entries for hosts using 'w' it will not resolve ipv6 related hostnames to ipv6 nuemric entries if the host has the same hostname entry with resolution on v4 and v6. For example: nistor@spike:~> w -n nistor 10:50PM up 43 days, 21:36, 24 users, load averages: 0.31, 0.27, 0.21 USER TTY FROM LOGIN@ IDLE WHAT nistor pts/19 cpexxxxxxxxxxxx-cmxxxxxxxxxxxx.cpe.net.c Sat02PM 2 -tcsh (tcsh) nistor pts/32 v6host.domain.com 10:47PM 2 -tcsh (tcsh) whereas: nistor@spike:~> w -nn nistor 10:50PM up 43 days, 21:36, 24 users, load averages: 0.31, 0.27, 0.21 USER TTY FROM LOGIN@ IDLE WHAT nistor pts/19 99.230.xxx.xxx Sat02PM 3 -tcsh (tcsh) nistor pts/32 v6host.domain.com 10:47PM 3 -tcsh (tcsh) If the host is an ipv6 host with no ipv4 resolution to it then the display works fine: nistor@spike:~> w david 10:55PM up 43 days, 21:41, 24 users, load averages: 0.31, 0.23, 0.19 USER TTY FROM LOGIN@ IDLE WHAT david pts/12 r2.ip6.domain.com 22Jan19 9:12 -/bin/tcsh nistor@spike:~> w -n david 10:55PM up 43 days, 21:41, 24 users, load averages: 0.31, 0.23, 0.19 USER TTY FROM LOGIN@ IDLE WHAT david pts/5 2001:XXX:yyyy:f000::2 22Jan19 28days alpine
Assign to net@: it appears to be related to IPV6.
I guess v6host.domain.com had multiple AAAA RRs. Is it correct?
No - It had a single A and a single AAAA associated to it.
When the hostname has multiple A and/or AAAA RRs, w(1) doesn't resolve an IP address, to avoid ambiguity. The utmp doesn't have any information about an IP address family.