ipinfodb lookup returns countryCode 'RD'

て烟熏妆下的殇ゞ 提交于 2019-12-11 02:17:56

问题


I am calling ipinfodb via JS. Recently I have had around 5-6 responses (from around 600) that specify the countryCode as 'RD'.

'RD' isn't a ccTLD and I cannot find any reason for this to be returned. Has anybody had a similar issue and did you find a fix?

I am calling ipinfodb on the route

http://api.ipinfodb.com/v3/ip-country/?key=_apikey_&ip=_ip_

回答1:


RD is returned as a pseudo-country code for reserved IP addresses.

This includes things like private addresses, class D and E networks (IPv4) and loopback.

For a complete list of addresses that will return this value, see here.

I can't actually find this behaviour documented anywhere, but experimentation easily demonstrates that this is the case, and moreover the <CountryName> element is populated with the word "Reserved" in these cases.




回答2:


RD is a short country code for "RESERVED" IP address range. It is a range reserved for certain networking purpose as approved by IETF.

This code is only used in IPInfoDB version 2 which has been deprecated.

You should upgrade to latest version 3 API which is constantly updated.

In v3, you will only see "-" in the country code results to avoid this confusion.



来源:https://stackoverflow.com/questions/13691815/ipinfodb-lookup-returns-countrycode-rd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!