resolver

package
v3.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package resolver contains a censoring DNS resolver. Most queries are answered without censorship, but selected queries could either be discarded or replied to with a bogon or NXDOMAIN answer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CensoringResolver

type CensoringResolver struct {
	// contains filtered or unexported fields
}

CensoringResolver is a censoring resolver.

func NewCensoringResolver

func NewCensoringResolver(
	blocked, hijacked, ignored []string, uncensored netx.Resolver,
) *CensoringResolver

NewCensoringResolver creates a new CensoringResolver instance using the specified list of keywords to censor. blocked is the list of keywords that trigger NXDOMAIN if they appear in a query. hijacked is similar but redirects to 127.0.0.1, where the transparent HTTP and TLS proxies will pick them up. dnsNetwork and dnsAddress are the settings to configure the upstream, non censored DNS.

func (*CensoringResolver) ServeDNS

func (r *CensoringResolver) ServeDNS(rw dns.ResponseWriter, req *dns.Msg)

ServeDNS serves a DNS request

func (*CensoringResolver) Start

func (r *CensoringResolver) Start(address string) (*dns.Server, error)

Start starts the DNS resolver

Jump to

Keyboard shortcuts

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