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_
有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top