Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IP to country without database

As we all know, there are many databases that can be used to return the country from a given IP address. I'm wondering about how do those database providers get these info from? who tells them that this IP address is located in that country and not another? is there a script that resolves these IPs or do they get many databases from every ISP and compile them into one? anyone has an idea?

Thanks

like image 693
medk Avatar asked Dec 14 '10 23:12

medk


People also ask

Can we get country from IP address?

Imp You can't get the country "just by looking at an IP address". Our service, IPinfo.io, infers the geographic location of IPs by pulling in many different data sources, and performing active scans across all IP addresses, and then publishes the results daily.

Is geolocation DB free?

The LITE edition is an open-source version of IP database with limited accuracy. It is free for personal or commercial use with attribution required.

How are IP address assigned to countries?

There are 232 (over four billion) IP addresses in the IPv4 protocol. Of these, almost 600 million are reserved and cannot be used for public routing. The rest are allocated to countries by the Internet Assigned Numbers Authority (IANA) via the regional Internet registries (RIRs).

What is a DB IP?

DB-IP is an online geolocation IP database. Users can look up IP addresses to find out locations of the IP addresses, as well as download and access the IP database. The DB-IP API allows developers to access and integrate the functionality of DB-IP with other applications.


2 Answers

Those databases are based primary on the information from the five RIRs that actually manage, allocate and register the ip addresses space. They also manage Autonomous System (AS) numbers within a defined region. The RIRs are :

  • African Network Information Centre (AfriNIC)
  • American Registry for Internet Numbers (ARIN)
  • Asia-Pacific Network Information Centre (APNIC)
  • Latin America and Caribbean Network Information Centre (LACNIC)
  • RIPE Network Coordination Centre (RIPE NCC)

This method is not perfect and is improved by various datamining, database merging between database maintainers and other methods such as analysis of user submitted data.

like image 70
Milan Avatar answered Oct 27 '22 01:10

Milan


I suspect they start at the IANA site to find the regional numbering authorities and work there way down to compile the info.

They also have this link which contains some top level info in xml format: http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml

like image 26
Brad Mace Avatar answered Oct 27 '22 00:10

Brad Mace