loop

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

README

loop

Name

loop - detect simple forwarding loops and halt the server.

Description

The loop plugin will send a random query to ourselves and will then keep track of how many times we see it. If we see it more than twice, we assume CoreDNS is looping and we halt the process.

The plugin will try to send the query for up to 30 seconds. This is done to give CoreDNS enough time to start up. Once a query has been successfully sent loop disables itself to prevent a query of death.

The query sent is <random number>.<random number>.zone with type set to HINFO.

Syntax

loop

Examples

Start a server on the default port and load the loop and forward plugins. The forward plugin forwards to it self.

. {
    loop
    forward . 127.0.0.1
}

After CoreDNS has started it stops the process while logging:

plugin/loop: Seen "HINFO IN 5577006791947779410.8674665223082153551." more than twice, loop detected

Limitations

This plugin only attempts to find simple static forwarding loops at start up time. To detect a loop, all of the following must be true

  • the loop must be present at start up time.
  • the loop must occur for at least the HINFO query type.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loop

type Loop struct {
	Next plugin.Handler

	sync.RWMutex
	// contains filtered or unexported fields
}

Loop is a plugin that implements loop detection by sending a "random" query.

func New

func New(zone string) *Loop

New returns a new initialized Loop.

func (*Loop) Name

func (l *Loop) Name() string

Name implements the plugin.Handler interface.

func (*Loop) ServeDNS

func (l *Loop) 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