dnsbl

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Overview

Package dnsbl implements DNS block lists (RFC 5782), for checking incoming messages from sources without reputation.

Index

Constants

This section is empty.

Variables

View Source
var ErrDNS = errors.New("dnsbl: dns error")

Functions

func CheckHealth

func CheckHealth(ctx context.Context, resolver dns.Resolver, zone dns.Domain) (rerr error)

CheckHealth checks whether the DNSBL "zone" is operating correctly by querying for 127.0.0.2 (must be present) and 127.0.0.1 (must not be present). Users of a DNSBL should periodically check if the DNSBL is still operating properly. For temporary errors, ErrDNS is returned.

Types

type Status

type Status string

Status is the result of a DNSBL lookup.

var (
	StatusTemperr Status = "temperror" // Temporary failure.
	StatusPass    Status = "pass"      // Not present in block list.
	StatusFail    Status = "fail"      // Present in block list.
)

func Lookup

func Lookup(ctx context.Context, resolver dns.Resolver, zone dns.Domain, ip net.IP) (rstatus Status, rexplanation string, rerr error)

Lookup checks if "ip" occurs in the DNS block list "zone" (e.g. dnsbl.example.org).

Jump to

Keyboard shortcuts

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