/iptoasn

Library for using Team Cymru's IP to ASN mapping service

Primary LanguageGoMIT LicenseMIT

IP to ASN GoDoc

Package iptoasn uses Team Cymru's IP to ASN mapping service for querying BGP origin information about a given IP address. It supports both IPv4 and IPv6 (of course, this isn't 1982).

This uses the DNS interface to the IP to ASN service rather than the WHOIS interface.

Usage

ip, err := iptoasn.LookupIP("2001:db8::1")
as, err := iptoasn.LookupASN("as20712")

Command-line tool

A whoisip command is provided as a simple tool for performing IP or AS lookups using the library.

License

MIT