UNIX networks - who command showing resolved name instead of IP - Aix

This is a discussion on UNIX networks - who command showing resolved name instead of IP - Aix ; When you type the "who" command on a UNIX system, you will get a list of users who are logged on, their device name, and their hostname or ip address (in the case of a pts connection). However, sometimes you ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: UNIX networks - who command showing resolved name instead of IP

  1. UNIX networks - who command showing resolved name instead of IP

    When you type the "who" command on a UNIX system, you will get a list
    of users who are logged on, their device name, and their hostname or ip
    address (in the case of a pts connection).

    However, sometimes you will see something like
    "(johndoe.someplace.com)" instead of "192.168.77.123" as their network
    address.

    We have a program that was written to allow 16 characters in that field
    to show an IP address, but now the screen is messed up because AIX 5.2
    is providing named hosts that are much longer than they used to be.

    We are planning a change to the field to limit it to 16 characters
    wide, but I am wondering if there are any variables or settings that
    can be used to restrict the hostname field so it shows only IP
    addresses in that column.

    Someone in a previous posting had suggested using NSORDER=hosts to
    another poster, but I tried that and it does not work. NSORDER is
    usually set to "local" or "bind" or a few other settings and the IBM
    documentation says nothing of a "hosts" value that can be used.

    For that matter, I tried "export NSORDER=local,bind" but that made no
    difference either.

    Any ideas?

    Steve


  2. Re: UNIX networks - who command showing resolved name instead of IP

    The point is simply: The who command takes the information out of the
    /etc/utmp file. The /etc/utmp file is written by the login programm. So
    the hostname should be written already during the login process.

    Solution: Write a wrapper script which figure out the IP number from
    the who command

    hth
    Hajo

    BTW: All from the man page


  3. Re: UNIX networks - who command showing resolved name instead of IP

    Not sure i have understood what you want, so have explained in 2
    directions.

    So you want ip addresses and not hostnames from the "who" output ? you
    will only get this is your system cannot resolve a hostname from an ip
    ...

    If you want short hostnames rather than fully qualified hostnames, then
    make sure /etc/hosts has the short hostname, then the fully qualified
    against the ip and then put the following in /etc/netsvc.conf

    hosts = local4,bind4

    HTH
    Mark Taylor


+ Reply to Thread