-
Notifications
You must be signed in to change notification settings - Fork 0
Lookup AS by IP? #18
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments 3 replies
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh okay. I was hoping there would be some easier API. Oh well. thanks anyway
Beta Was this translation helpful? Give feedback.
All reactions
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1