http://www.free-dc.org/forum/showthr...highlight=IANA
Quote:
quote:Originally posted by Mystwalker
How accurate is the reserve lookup when it comes to identifying the country?
quote:From the new page
Beware: these statistics are only estimated. They are based on the two-letter country code of the IP address from where the work was submitted. Since some IP addresses don't resolve properly to hostnames, and some hostnames' country codes are not really the country where the IP is located, there is inherently some error in these numbers. Also, it should be noted that non-country-code domains like .com, .net, .edu and so on are included in the United States' totals, since most US domains end in these instead of .us.
Quote:
When you do a reverse DNS lookup on an IP address, you get a hostname like "foo-bar-27.wanadoo.fr". The by-country rank script extracts the top level domain (TLD) "fr" from the address, consults an internal lookup table of all the country codes, and tallies that address up to the totals for France.
This works reasonably well for every country but the United States. Even though there is a "us" TLD, its use is mostly restricted to government or educational use. The script just assumes that "com", "edu", "net", "org", "gov", "mil" and anything else that isn't a country code is probably from the United States. I suspect the US's totals are probably artificially high because of this, but probably not by too much (certainly not enough for it to drop from the #1 spot).
There probably is a better way to get more accurate country information from ARIN, RIPE and so on, but it would probably be a lot slower and a LOT more programming. If anybody knows of easier ways to do this, I'm all ears.
- Kugano
Quote:
While I admit the DNS solution isn't perfect, I'm not sure I'm ready to allow users to choose their country in their preferences either. The reason is that, while certainly no one here falls into this category, there are a lot of dishonest people out there who would choose a country other than their actual country. The by-country page would then become a popularity contest, and that's not what they're meant to be at all.
I'm going to look into the idea someone suggested earlier on the forum about using IANA/ARIN/RIPE/etc. data to determine country ... someone, somewhere, has to have come up with a database mapping IP ranges to countries.
- Kugano
Quote:
Any RPSL compliant inetnum object should have a country field containing the 2-letter ISO-3166 country code - but bear in mind that the object data may have been edited by error-prone humans (like me). Unfortunately, there's no guarantee that ARIN data will be as standard as RADB/RIPE/APNIC/CW etc
A query to whois with the flag to search any database will cover most bases, but would generate a LOT of lookups - you should then either cache answers, or probably run your own IRRd with live updates from RADB/RIPE etc. This may be more involvement than you're looking for....
Using the RIPE whois client, the following pipeline would give
you approx what you're after:
whois -a -r -T inetnum <ipaddress> | egrep '^country:'
- Vato
Those are simply some excerpts.
I suggest checking the linked thread to get the full details of the discussion.
In regards to an accurate, feasible and relatively easy solution, I don't remember one being proposed but I am sure that Louie and Dave would love to hear of one if it exists.