Identifying country by IP address

前端 未结 13 1047
盖世英雄少女心
盖世英雄少女心 2020-12-01 05:24

Is there a way to figure out the country name just by looking at an IP address? I mean, do countries have specific ranges of IP addresses? For example, Australia can have IP

13条回答
  •  广开言路
    2020-12-01 05:55

    Yes, countries have specific IP address ranges as you mentioned.

    For example, Australia is between 16777216 - 16777471. China is between 16777472 - 16778239. But one country may have multiple ranges. For example, Australia also has this range between 16778240 - 16779263

    (These are numerical conversions of IP addresses. It depends whether you use IPv4 or IPv6)

    More information about these ranges can be seen here: http://software77.net/cidr-101.html

    We get the ip addresses of our website visitors and sometimes want to make relevant campaign for a specific country. We were using bulk conversion tools but later on decided to define the rules in an Excel file and convert it in the tool. And we have built this Excel template: https://www.someka.net/excel-template/ip-to-country-converter/

    Now we use this for our own needs and also sell it. I don't want it to be a sales pitch but for those who are looking for an easy solution can benefit from this.

提交回复
热议问题