1

On Redhat 7.4(maipo) server I am seeing issues as below.

Prior to RHEL 7.4 let say RHEL 7.3 if I login to server though putty using my local IP 192.168.187.1 and execute who command it was showing as below:

# who  -H
NAME     LINE         TIME          COMMENT
root     pts/0        2017-12-30 00:51  (192.168.187.1)

Note the comment column, it is showing as from where I login to the Redhat server(192.168.187.1 is my local machine IP),

Now if I edit /etc/hosts of RHEL 7.3 server as below,

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.187.1   test

And re login the same RHEL 7.3 server, the who op is showing as below (see comment column):

# who –H
NAME     LINE         TIME                      COMMENT
root         pts/0        2017-12-30 00:51      (test)

But if I do the same thing with RHEL 7.4 server its not showing test as hostname of my local server, instead of that I am getting IP address only as shown below:

# who  -H
NAME     LINE         TIME                  COMMENT
root     pts/0        2017-12-30 00:51  (192.168.187.1)

Can anyone help me so that who command will show hostname instead of IP address in COMMENT column. I also have checked the /etc/nsswitch.conf file but 7.4 and prior versions have almost same setting.

I also tried with Centos 7 latest version, it has the same issue, prior to RHEL 7.4 if I do as shown above with /etc/hosts I used to get who op’s COMMENT as hostname instead of IP address.

  • are it's a local server ? or you getting it from a company which they overwrite the config each time you log in/out ? – αԋɱҽԃ αмєяιcαη Dec 30 '17 at 8:50
  • I've version 7.4 and it works as you expect it to (IP addresses resolve); so it's most probably a name resolution issue. Try using host or nslookup to double-check your name resolution. – garethTheRed Dec 30 '17 at 8:58
  • Hi Friend, I have not done any DNS or ip to host mapping yet, this is just my 1st step to check whether who is reading from /etc/hosts file not not as it turned out to be not, we need not have to configure name resolution with ip to make who work like the example I provided, local machine is my host system and redhat is running in VMware, who gies me desired o/p as mentioned above example without any named server configuration with redhat 7.3 and prior – Rakesh P Dec 30 '17 at 9:58
  • Now I have done naming resolution , still have the same issue any idea, – Rakesh P Dec 31 '17 at 10:10
  • upgraded to redhat 7.5 and issue resolved, must be a bug in 7.4 – Rakesh P May 8 '18 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.