fakedns

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDNS

func RegisterDNS(dns string)

Types

type FakeDNS

type FakeDNS interface {
	Start() error
	Stop() error

	// Resolve a fake dns response for the specify request.
	Resolve([]byte) ([]byte, error)

	// IPToHost returns the corresponding domain for the given IP.
	IPToHost(ip net.IP) (string, bool)
}

type Resolver

type Resolver struct {
	*D.Server
	ServeAddr string
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(a, h string) (*Resolver, error)

func (*Resolver) IPToHost

func (r *Resolver) IPToHost(ip net.IP) (string, bool)

func (*Resolver) Resolve

func (r *Resolver) Resolve(request []byte) ([]byte, error)

func (*Resolver) ServeDNS

func (r *Resolver) ServeDNS(w D.ResponseWriter, req *D.Msg)

func (*Resolver) Start

func (r *Resolver) Start() error

func (*Resolver) Stop

func (r *Resolver) Stop() error

Jump to

Keyboard shortcuts

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