dnsbl

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package dnsbl looks up connecting IP addresses in DNS blocklists, telling a listing apart from the error codes lists return to resolvers they refuse.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listed

func Listed(addrs []net.IPAddr) bool

Listed decides whether an answer means "listed". Lists answer inside 127.0.0.0/8; 127.255.255.x (Spamhaus) and 127.0.0.1 are errors or tests.

func Query

func Query(ip net.IP, list string) string

Query is the name to look up for ip in list.

Types

type Checker

type Checker struct {
	DNS dnsx.Resolver
	// contains filtered or unexported fields
}

Checker queries lists and caches answers for an hour.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context, ip net.IP, lists []string) []string

Check returns the lists that list ip. Private and loopback addresses are never checked.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL