Unix/Linux Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Get ip of client, not hostname

HP-UX


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 2 Weeks Ago
boltpower boltpower is offline
Registered User
 
Join Date: Sep 2017
Last Activity: 8 September 2017, 12:29 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Get ip of client, not hostname

Hello i'm trying to get the ip of a telnet session.

With who -u I get the hostname of the user connecting to my server, because it checks the reverse DNS. But I only want the ip.

Versions: HP-UX HP Release B.11.31
Who command: Hewlett-Packard Company - 4 - HP-UX 11i Version 3 Feb 2007

Do you know another command? Or how block the use of the reverse DNS?

Thank you!
Sponsored Links
    #2  
Old Unix and Linux 2 Weeks Ago
rbatte1 rbatte1 is online now Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 25 September 2017, 8:55 AM EDT
Location: Lancashire, UK
Posts: 3,261
Thanks: 1,391
Thanked 630 Times in 569 Posts
I think that the reverse DNS is looked up at login time and recorded. You would just need to look up the DNS name to get the IP again though.

You might use one of:- dig, host, nslookup or something else, even ping might do it for you.


I hope that this helps,
Robin
Sponsored Links
    #3  
Old Unix and Linux 2 Weeks Ago
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 25 September 2017, 6:22 AM EDT
Location: Simplicity
Posts: 3,749
Thanks: 307
Thanked 1,258 Times in 1,137 Posts
There is the HP-UX specific getip command

Code:
who -u | while read line
do
  ip=$(getip "${line##* }")
  echo "$line  $ip"
done

The Following User Says Thank You to MadeInGermany For This Useful Post:
rbatte1 (2 Weeks Ago)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Hostname -f hostname: Unknown host hce UNIX for Advanced & Expert Users 0 05-12-2014 08:01 AM
HP UX - ILO Console hostname different than Machine Hostname... zixzix01 Emergency UNIX and Linux Support 4 08-25-2011 07:25 PM
What hostname is a client using? mugambo UNIX for Advanced & Expert Users 1 10-10-2007 10:13 AM
Solaris - unknown hostname - how can I change hostname? XNOR UNIX for Dummies Questions & Answers 1 03-29-2007 10:52 PM



All times are GMT -4. The time now is 09:22 AM.