An (Unofficial) Golang client for Farsight Security's DNSDB (https://api.dnsdb.info/)
import "github.com/bored-engineer/go-dnsdb"To list all RRSet records matching www.farsightsecurity.com:
records, _, err := client.RRSet.LookupName("www.farsightsecurity.com", nil)
if err != nil {
panic(err)
}
for _, record := range records {
fmt.Println("%s: %v", *record.RRName, record.RData)
}For furthur usage see the GoDocs.
The dnsdb library does not directly handle authentication. Instead, when creating a new client, you can pass a http.Client that handles authentication for you. It does provide a APIKeyTransport structure when using API Key authentication. It is used like this:
tp := dnsdb.APIKeyTransport{
APIKey: "d41d8cd98f00b204e9800998ecf8427e",
}
client := dnsdb.NewClient(tp.Client())