https://github.com/jamesog/iptoasn
Library for using Team Cymru's IP to ASN mapping service
https://github.com/jamesog/iptoasn
asn ip teamcymru
Last synced: 5 months ago
JSON representation
Library for using Team Cymru's IP to ASN mapping service
- Host: GitHub
- URL: https://github.com/jamesog/iptoasn
- Owner: jamesog
- License: mit
- Created: 2019-04-27T14:20:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-27T16:18:32.000Z (over 6 years ago)
- Last Synced: 2025-04-30T06:08:33.407Z (5 months ago)
- Topics: asn, ip, teamcymru
- Language: Go
- Size: 3.91 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IP to ASN [](https://godoc.org/github.com/jamesog/iptoasn)
Package `iptoasn` uses [Team Cymru](https://www.team-cymru.com/)'s [IP to ASN](https://www.team-cymru.com/IP-ASN-mapping.html) 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
```go
ip, err := iptoasn.LookupIP("2001:db8::1")
``````go
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