knadh / dns.toys

A DNS server that offers useful utilities and services over the DNS protocol. Weather, world time, unit conversion etc.
https://www.dns.toys
MIT License
2.48k stars 135 forks source link

Lookup ASN and AS Name #70

Open jamesharr opened 8 months ago

jamesharr commented 8 months ago

One thing that is pretty common in the network engineering field is to look up an IP's AS Number and/or looking up an ASN's name based on its number. I think it'd be a very useful addition to dns toys.

There's a lot of ways to implement this:

Draft usage example:

# Lookup an ASN 
% dy 8.8.8.8.origin
% dy 2001:4860:4860::8844.origin
"15169"  # simplified form
"AS15169"  # alternative
"15169 | 8.8.8.0/24 | US | arin | 2023-12-28"  # Same output that CYMRU uses; has the most information in it
"AS15169 GOOGLE, US"  # Another acceptable output, cidr-report.org format

% dy 15619.asn
% dy as15619.asn
"GOOGLE, US"  # Simplest form
"AS15169 GOOGLE, US"  # cidr-report.org format
"15169 | US | arin | 2000-03-30 | GOOGLE, US"  # Same output that CYMRU uses; has the most information in it

References:

Shivraj0 commented 1 month ago

Hello @knadh, Had this been taken up? If not, can i take this?

knadh commented 1 month ago

Please feel free @Shivraj0.