sleach / ipisp

Golang IP to ISP library utilizing team cymru's IP to ASN service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPISP

IPISP wraps Team Cymru's IP to ASN service.

Features

  • Programmatically resolve an IP address's AS number, ISP name, range, allocation time, registry, and country of registration.
  • Safe for bulk usage by using Cymru's DNS interface
  • Concurrent safe

Godoc

Example

A more thorough example is in the examples/ folder.

client, _ := ipisp.NewDnsClient()
resp, err := client.LookupIP(net.ParseIP("4.2.2.2"))
   
fmt.Printf("IP: %v\n", resp.IP)
fmt.Printf("ASN: %v\n", resp.ASN)
fmt.Printf("Range: %v\n", resp.Range)
fmt.Printf("Country: %v\n", resp.Country.Name)
fmt.Printf("Registry: %v\n", resp.Registry)
fmt.Printf("ISP: %v\n", resp.Name.Raw)

About

Golang IP to ISP library utilizing team cymru's IP to ASN service

License:MIT License


Languages

Language:Go 100.0%