blocker

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

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Blocker

Name

blocker - Redirect banned hosts to 0.0.0.0

Description

blocker redirects hosts' IP addresses to 0.0.0.0 instead of resolving the related IP address.

Syntax

blocker hosts

Metrics

If monitoring is enabled (via the prometheus plugin) then the following metrics are exported:

  • coredns_blocker_{domain} - Count of the blocked hosts

Examples

Hosts file example Steven Black

example.com {
    blocker hosts
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocker

type Blocker struct {
	Next  plugin.Handler
	Hosts map[string]struct{}
}

func (Blocker) Name

func (b Blocker) Name() string

func (Blocker) ServeDNS

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

Jump to

Keyboard shortcuts

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