Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lookup AS by IP? #18

Unanswered
trekzavier asked this question in Q&A
Feb 4, 2026 · 4 comments · 3 replies
Discussion options

Hey, great package! Is there a way to look up IPs by AS? There is as-ip-blocks, but you have to already know the AS. Is there anyway to find out the AS by the IP address? Similar to when I type IP into https://lens.ipverse.net/ and it returns the AS along with additional data. Thank you for any information!

You must be logged in to vote

Replies: 4 comments 3 replies

Comment options

Hi, this it not planned at the moment but you could always write an offline-ish CLI to reverse the data. Here's an example: https://github.com/ipverse/tools/tree/master/ip2as

You must be logged in to vote
1 reply
Comment options

Thanks for the link. I actually tried creating my own script doing that exactly. But loading all of the AS entries takes a lot of memory and crashes my computer. I don't need every entry, just the ones from the IP's I look up. Is there any other way?

Comment options

It‘s a lot of data. You can trade speed for RAM usage but would have to come up with some custom sort/filter logic.

You must be logged in to vote
1 reply
Comment options

Oh okay. I was hoping there would be some easier API. Oh well. thanks anyway

Comment options

Hey, I just came across this same issue and had a question by your comment here.

It‘s a lot of data. You can trade speed for RAM usage but would have to come up with some custom sort/filter logic.

I took a look at your example at https://github.com/ipverse/tools/tree/master/ip2as as well. I suspect that reading from the filesystem is a lot more computer intensive than just using a light database like SQLite or Postgres. Was there any reason a database wasn't used for faster lookups and less memory usage?

You must be logged in to vote
1 reply
Comment options

Hey @trick77 I meant to @ mention you in my earlier comment. That was for you, sorry about any potential confusion. Would love to know your thoughts there. Thank you!

Comment options

Hey @markcellus, no worries.

Mainly wanted to keep it dependency-free and simple to consume. Flat files can be piped through grep, used from scripts, etc. without needing a DB layer. But yeah, if you need fast lookups at scale, throwing it into SQLite would make sense. The format is simple enough that you could vibe code an import script in about a minute.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /