Where is my IP location

Where is my IP location

Here you will get general information about

  1. Internet Protocol Registries.
  2. Programmatically access the location information about IP address. (IP to location).
    API explained in below example use HTTP get method. you need to pass the IP parameter value
    in query string.

Regional Internet Registries world MAP

IP to Location Registries

The above five non profit organizations registers and administers Internet Protocol IP address.

  1. AfriNIC http://www.afrinic.net/
    Geographical regions: Africa, portions of the Indian Ocean
  2. APNIC http://www.apnic.net/
    Portions of Asia, portions of Oceania
  3. ARIN https://www.arin.net/about_us/index.html
    Canada, many Caribbean and North Atlantic islands, and the United States
  4. LACNIC http://www.lacnic.net/en/
    Latin America, portions of the Caribbean
  5. RIPE NCC http://www.ripe.net/
    Europe, the Middle East, Central Asia

Range of IP addresses are distributed among those regions.

How to trace location of IP address:

Replace the IP address shown in below URL with the IP address you would like to locate.

URL http://whatismyipaddress.com/ip/117.195.106.215

image

What is my IP address

(URL What Is My IP Address? Lookup IP, Hide IP, Change IP, Trace IP and more... ) will
show you your IP address. As shown in above picture you can see the location of IP inside the Google MAP.
Geographical information gives you Country, State or Region, Latitude and Longitude data.
Longitude and Latitude data are enough to get exact location of IP address using Google MAP.

IP to Location API

Use below API to get IP locations programmatically.

http://www.hostip.info/use.html

using System;
using System.Net;
using System.IO;
using System.Web;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
// string IpAddress = HttpContext.Current.Request.UserHostAddress;
string IpAddress = "117.195.98.123";
string URL = "http://api.hostip.info/country.php?IP=" + IpAddress;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
Console.WriteLine(reader.ReadToEnd());
reader.Close();
Console.ReadKey();
}
}
}


 

Description: Uncomment the code to get end user IP address programmatically, if you are using web application
to trace the IP location. you can also replace the hard coded IP address with the IP addresses found in Database.
You need to add reference of System.Web in your class library project or console application.
Instance of HttpWebRequest class creates the link between your server and IP to location API server.
Same way response object of HttpWebResponse holds the response of response stream returned by IP to location API.

There are so many free and commercial IP to location API provider. To send request from PHP server to IP to
location API provider, use Curl libraries. In .net application use HttpWebRequest and HttpWebREsponse classes found at System.Net namespace.

You can download the database of IP to location from below location

http://ip-to-country.webhosting.info/downloads/ip-to-country.csv.zip Size around 5MB.

This database get updated monthly. Database provides only information about the country which has that IP address.

Web service for IP to Location
http://freegeoip.appspot.com/

This is free tool and you can find below information

  1. Country (code/name)
  2. Region (code/name)
  3. City
  4. Zip Code
  5. Latitude
  6. Longitude

Information is accurate and you can retrieve the Data in various formats like CSV, JSON or XML.

How to change your IPLinq Group By Multiple ColumnsMembership ProviderASp.net 2.0 step by step Membership Provider Online html editor online JavaScript editorYour own Ip to location IP to locationPostback from JavaScriptASp.net RegisterClientScriptBlockJavaScript For LoopMemberShip Count Online Users

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.