|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi, i want to get the hostname for the specified IP address. Code:
# host www.google.com www.google.com has address 173.194.69.104 www.google.com has address 173.194.69.105 www.google.com has address 173.194.69.106 www.google.com has address 173.194.69.147 www.google.com has address 173.194.69.99 www.google.com has address 173.194.69.103 # host 173.194.69.99 99.69.194.173.in-addr.arpa domain name pointer bk-in-f99.1e100.net. Is there any way to get host name as "www.google.com" for the given IP address (173.194.69.99)? "gethostbyaddr" function also returns same host name(bk-in-f99.1e100.net.) as above but i want "www.google.com" as the host name. thanks in advance ![]() Regards, kavitha |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Something like this? Code:
awk '$NF=="173.194.69.99"{print $1}' host_file |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
No, actually "173.194.69.99" belongs to google then ,why are we not getting www.google.com as host name other than internal name "bk-in-f99.1e100.net."
is there any function to get actual host names? |
|
#4
|
||||
|
||||
|
I don't think there is a way. It is up to google what PTR records they provide for reverse lookups. You could use
whois to try and find the IP-address owner..
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| IP address to decimal format conversion | vaibhavkorde | Shell Programming and Scripting | 2 | 03-15-2011 01:11 PM |
| get host name by IP address | limmer | Programming | 6 | 12-18-2009 06:24 AM |
| host name to IP address | cleopard | Programming | 7 | 04-11-2008 09:27 AM |
| Host ID vs MAC Address | TheBlueSky | Solaris | 4 | 02-03-2007 09:10 AM |
| How to get the host ip address in HP-UX in ksh? | nir_s | Shell Programming and Scripting | 12 | 08-07-2005 08:01 PM |
|
|