Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("server not found")
ErrNotFound is returned when a WHOIS server cannot be found for a given IP
Functions ¶
func DetermineServer ¶
DetermineServer determines the appropriate whois server to query for a particular IP
Example ¶
package main
import (
"fmt"
"net"
"github.com/tzneal/ripelookup"
)
func main() {
server, _ := ripelookup.DetermineServer(net.ParseIP("8.8.8.8"))
fmt.Println(server)
}
Output: whois.arin.net
Types ¶
type Record ¶
Record is a single WHOIS record for an IP Address
func WhoisIP ¶
WhoisIP performs a WHOIS against a server for an IP Address, returning the matching records
Example ¶
package main
import (
"fmt"
"net"
"github.com/tzneal/ripelookup"
)
func main() {
ip := "8.8.8.8"
server, _ := ripelookup.DetermineServer(net.ParseIP(ip))
records, _ := ripelookup.WhoisIP(ip, server)
fmt.Println(records[0])
}
Output:
Click to show internal directories.
Click to hide internal directories.