2023-09-20 09:28:52 +01:00
|
|
|
# dnsxl
|
|
|
|
|
2023-09-20 12:21:59 +01:00
|
|
|
DNS xList (blocklist / allowlist / RBL) implementation for Go, based on
|
|
|
|
[RFC 5782](https://www.rfc-editor.org/rfc/rfc5782).
|
|
|
|
|
|
|
|
Quick start:
|
|
|
|
|
|
|
|
```go
|
|
|
|
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`.
|