-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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:
- acting as a proxy for the CYMRU DNS service (with or without using an external dependency)
- using HTTP API services
- Implementing the lookup internally and pre-caching/refreshing the data periodically. I'm figuring that's probably a point best left for discussion.
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:
- Go library utilizing CYMRU's DNS based lookup service - https://pkg.go.dev/github.com/jamesog/iptoasn
- Underlying service https://www.team-cymru.com/ip-asn-mapping#comp-l529r139
- https://github.com/jamesog/iptoasn/blob/master/iptoasn.go#L92-L93 - IP-to-ASN lookup
- https://github.com/jamesog/iptoasn/blob/master/iptoasn.go#L158 - AS-name lookup
- based on prior research, this is what most people use for ASN -> AS-Name mapping
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request