tags:

views:

994

answers:

6

How to know who is my ISP provider?

Is it possible to use php to track it?

EDIT:

if i use :

gethostbyaddr($_SERVER['REMOTE_ADDR']);

it returns my ip address, not my host name...

A: 

I think you need to use some third party service (Possibly a web service) to lookup the IP and find the service provider.

Chathuranga Chandrasekara
+1  A: 

This seems to be what you're looking for, it will attempt to return the full hostname if possible:

http://us3.php.net/gethostbyaddr

Nicholas Flynt
this is what i am looking for.. Thanks a lot
Didn't get you.. How do you find the service provider using this? Please make a clarification if can
Chathuranga Chandrasekara
wait.. it return my ip address... this is not i wanted
This function as any kind RDNS lookup (reverse DNS), only works if the IP address has a registered RDNS record. Also remember that all domain names registered have an IP, but not all the IPs have a related domain.
backslash17
+3  A: 

There is nothing in the HTTP headers to indicate which ISP a user is coming from, so the answer is no, there is no PHP builtin function which will tell you this. You'd have to use some sort of service or library which maps IPs to networks/ISPs.

James Baker
A: 

go to http://whatismyip.com

this will give you your internet address. Plug that address into the database at http://arin.net/whois

Eddy
And that relates to doing it through PHP how, exactly?
Chad Birch
I don't see your better method using php Chad. You could use curl, or a whois - many options but if you don't know about arin or whois the information I provided is helpful.
Eddy
A: 

GeoIP will help you with this: http://www.maxmind.com/app/locate_my_ip

There is a php library for accessing geoip data: http://www.maxmind.com/app/php

Attention though, you need to put the geoip db on your machine in order to make it work, all instructions are there :)

schmilblick
A: 

You can't rely on either the IP address or the host name to know the ISP someone is using. In fact he may not use an ISP at all, or he might be logged in through a VPN connection to his place of employment, from there using another VPN or remote desktop to a hosting service halfway around the world, and connect to you from that. The ip address you'd get would be the one from either that last remote machine or from some firewall that machine is sitting behind which might be somewhere else again.

jwenting