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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址