DNS xList (block/allow) implementation.
Go to file
Laurence Withers 15b34b43ad Initial working version, with example. 2023-09-20 12:26:06 +01:00
cmd/example Initial working version, with example. 2023-09-20 12:26:06 +01:00
.gitignore Initial working version, with example. 2023-09-20 12:26:06 +01:00
LICENSE Initial working version, with example. 2023-09-20 12:26:06 +01:00
README.md Initial working version, with example. 2023-09-20 12:26:06 +01:00
go.mod Initial working version, with example. 2023-09-20 12:26:06 +01:00
reverse.go Initial working version, with example. 2023-09-20 12:26:06 +01:00
reverse_test.go Initial working version, with example. 2023-09-20 12:26:06 +01:00
server.go Initial working version, with example. 2023-09-20 12:26:06 +01:00
xlist.go Initial working version, with example. 2023-09-20 12:26:06 +01:00

README.md

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.