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 09-08-2017   -   Original Discussion by boltpower
boltpower's Unix or Linux Image
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 09-08-2017   -   Original Discussion by boltpower
rbatte1's Unix or Linux Image
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 18 January 2018, 10:38 AM EST
Location: Lancashire, UK
Posts: 3,438
Thanks: 1,493
Thanked 671 Times in 604 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 09-08-2017   -   Original Discussion by boltpower
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 18 January 2018, 4:14 AM EST
Location: Simplicity
Posts: 3,933
Thanks: 333
Thanked 1,315 Times in 1,185 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 (09-11-2017)
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 09:01 AM
HP UX - ILO Console hostname different than Machine Hostname... zixzix01 Emergency UNIX and Linux Support 4 08-25-2011 08:25 PM
What hostname is a client using? mugambo UNIX for Advanced & Expert Users 1 10-10-2007 11:13 AM
Solaris - unknown hostname - how can I change hostname? XNOR UNIX for Dummies Questions & Answers 1 03-29-2007 11:52 PM



All times are GMT -4. The time now is 02:07 PM.