On Thu, Sep 13, 2012 at 17:48, Michael W. Lucas wrote: > w(1) gives the -a option: > > -a Attempt to translate network addresses into names. > > But this appears to be the default: > > wrath~;w > 5:46PM up 8 days, 1:08, 1 user, load averages: 0.50, 0.45, 0.37 > USER TTY FROM LOGIN@ IDLE WHAT > mwlucas p0 adsl-99-103-114- 5:44PM 0 w > > Adding -a doesn't change the output. > > I would *think* (there's my problem, I know) that if -a is the > default, then there would be a -n or somesuch to turn off hostname > resolution. What am I missing here?
It depends on the program writing the utmp entry. If it writes the hostname, then that's what it prints. -a will attempt to turn it into a hostname *again*. The source even calls the option 'nflag' internally, it's on by default. -a turns it off.