intercept

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

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

Go to latest
Published: Jul 27, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

README

intercept

Name

intercept - Query interception plugin.

Coverage License CI Go Report Card

Description

The intercept plugin intercepts queries and returns predefined responses for specific clients

Syntax

intercept [ZONE...] {
    record TTL CLASS RR-TYPE ANSWER... [net NETWORK...]
}
  • ZONE zones it should be authoritative for. If empty, the zones from the configuration block are used.
  • TTL sets the DNS TTL of the answers generated
  • CLASS the query class (usually IN or ANY).
  • RR-TYPE the query type (A, PTR, ... can be ANY to match all types). "*" stands for all record types.
  • ANSWER the answers to return, multiple answers allowed
  • NETWORK is the source IP address to match for the requests to be intercepted. Typical CIDR notation and single IP address are supported. "*" stands for all possible source IP addresses.

Examples

. {
    intercept a.example.org {
        record 3600 IN * 127.0.0.2 net 192.168.1.0/24
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Intercept

type Intercept struct {
	Next  plugin.Handler
	Rules []rule
}

Intercept implements the intercept plugin

func (Intercept) Name

func (i Intercept) Name() string

Name implements the Handler interface.

func (Intercept) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

Jump to

Keyboard shortcuts

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