coredns_blackhole

package module
v0.0.0-...-d6e7420 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: GPL-3.0 Imports: 18 Imported by: 0

README

Build Status

coredns_blackhole

Name

blackhole - Applies bocklists to DNS queries

Description

The blackhole plugin downloads blocklists and applies them to the DNS queries. If a requested address matches a blocklist entry, the request will be rejected.

Syntax

blackhole [BLOCKLIST_FILE... ] [BLOCKLIST_URL... ] {
    refresh SECONDS
}

If the argument is a valid path to a file, the file will be interpreted as a list of blocklist urls. Each url is then downloaded and added to the blocklist.

If the argument is a valid url, the url is downloaded and added to the blocklist.

The refresh option sets the timer for the refresh of the blocklists. Default is 30 seconds.

Examples

Block all urls in the simple_ad list and forward the rest.

. {
    blackhole https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt {
        refresh 60
    }
    forward tls://1.1.1.1 tls://1.0.0.1
}
    

Documentation

Index

Constants

View Source
const BlockedRcode = dns.RcodeRefused

Variables

Functions

This section is empty.

Types

type Blackhole

type Blackhole struct {
	Next      plugin.Handler
	Blocklist *Blocklist
}

func (Blackhole) Name

func (b Blackhole) Name() string

func (Blackhole) ServeDNS

func (b Blackhole) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

type Blocklist

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

func NewBlocklist

func NewBlocklist() *Blocklist

func (Blocklist) Add

func (b Blocklist) Add(s string)

func (Blocklist) Find

func (b Blocklist) Find(s string) bool

func (Blocklist) Len

func (b Blocklist) Len() (length int)

type Options

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

func NewOptions

func NewOptions() Options

Jump to

Keyboard shortcuts

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