dnsxl/README.md

533 B

dnsxl

DNS xList (blocklist / allowlist / RBL) implementation for Go, based on RFC 5782.

Quick start:

import "src.lwithers.me.uk/go/dnsxl"

func main() {
    xlist := dnsxl.New(nil)
    xlist.AddServers("zen.spamhaus.org")
    res, err := xlist.LookupIP(net.IP4(102, 158, 172, 138)
    if err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
    fmt.Printf("Weight: %d\n", res.Weight())
}

A slightly more fully-fledged example is found in cmd/example.