Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP Address Resolution

Status
Not open for further replies.

SetoKaiba

Programmer
Jun 16, 2004
28
0
0
US
I am not sure if PHP has a function to support this, *Searched PHP.net for it* Does anyone know a very efficient way of doing IP Resolution without going away from PHP/Javascript? (When I mean IP Resolution I mean take in an IP Address, output the lookup, which is like, nyc.rr.1.1.1.1)
 
yes it does, but it is not good practice and does (i have found) slow down the server as it processes the requests.
 
2 functions here I think:

Code:
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  
echo $hostname;

$ip = gethostbyname('[URL unfurl="true"]www.example.com');[/URL]

echo $ip;

can be found here :
gethostbyname and gethostbyaddr


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
work backwards as well i.e. see if the ip of the hostname you get back is the same as the source one (or at least in the possible list of address you get back)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top