4 ms·
Or if an API works for you, https://ipinfo.io https://ipinfo.io $ curl ipinfo.io/8.8.8.8 { "ip": "8.8.8.8", "hostname": "google-public-dns-
by coderholic 10y ago
Or if an API works for you, https://ipinfo.io https://ipinfo.io
$ curl ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0840",
"org": "AS15169 Google Inc.",
"postal": "94035",
"phone": "650"
}
$ curl ipinfo.io/8.8.8.8/org
AS15169 Google Inc.
And ASN details are available on the web, eg https://ipinfo.io/AS15169 https://ipinfo.io/AS15169
- packetized 10y agoI'd like this service a lot more if it had a "last_refreshed" field. BGP/network-announcement hijacks aren't exactly common, but it'd be a useful bit of info to have in terms of determining how reliable the announcement is.
- jlgaddis 10y agoBy "reliable" it sounds like you mean "legitimate"? As in, $asn is "authorized" to announce $prefix? "originAS" exists for that purpose. Also, it's not clear what they're (ipinfo.io) using as their source for the ASN. Are they simply reporting the ASN as provided by ARIN, etc., or are they actually running BGP and reporting the origin ASN as they see it in announcements. My money would be on the former, in which case any prefix hijacking would not affect the data reported by ipinfo.io.
- packetized 10y agoBy "reliable", what I mean is that the IP address to ASN mapping is as up-to-date as possible.
- jlgaddis 10y agoI don't think a "last_refreshed" date would be that helpful, though. Netblocks aren't being shuffled around very often. I just looked at a previous employer's assignments and it was almost a decade ago that it was last updated. It's still 100% accurate, however. Regardless, if you want it, that data is available from the RIRs. Go crazy.
- deleted 10y ago[deleted]
- justinsaccount 10y agoThat works for one lookup. The service I'm building on top of pyasn uses zeromq and can do 100,000+ lookups/sec There's often a disconnect between something like that which works for one address, and something I could actually use to do bulk lookups on 5,000,000 addresses to generate reports.