dns

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 15 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EnhancedModeMapping is a mapping for EnhancedMode enum
	EnhancedModeMapping = map[string]EnhancedMode{
		NORMAL.String():  NORMAL,
		FAKEIP.String():  FAKEIP,
		MAPPING.String(): MAPPING,
	}
)

Functions

func ReCreateServer

func ReCreateServer(addr string, resolver *Resolver) error

Types

type Config

type Config struct {
	Main, Fallback []NameServer
	IPv6           bool
	EnhancedMode   EnhancedMode
}

type EnhancedMode

type EnhancedMode int
const (
	NORMAL EnhancedMode = iota
	FAKEIP
	MAPPING
)

func (EnhancedMode) MarshalJSON

func (e EnhancedMode) MarshalJSON() ([]byte, error)

MarshalJSON serialize EnhancedMode with json

func (EnhancedMode) MarshalYAML

func (e EnhancedMode) MarshalYAML() ([]byte, error)

MarshalYAML serialize EnhancedMode with yaml

func (EnhancedMode) String

func (e EnhancedMode) String() string

func (*EnhancedMode) UnmarshalJSON

func (e *EnhancedMode) UnmarshalJSON(data []byte) error

UnmarshalJSON unserialize EnhancedMode with json

func (*EnhancedMode) UnmarshalYAML

func (e *EnhancedMode) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unserialize EnhancedMode with yaml

type NameServer

type NameServer struct {
	Net  string
	Addr string
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) *Resolver

func (*Resolver) Exchange

func (r *Resolver) Exchange(m *D.Msg) (msg *D.Msg, err error)

func (*Resolver) IPToHost

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

func (*Resolver) ResolveIP

func (r *Resolver) ResolveIP(host string) (ip net.IP, err error)

type Server

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

func (*Server) ServeDNS

func (s *Server) ServeDNS(w D.ResponseWriter, r *D.Msg)

Jump to

Keyboard shortcuts

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