freedns

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FastDNS   string
	CleanDNS  string
	Listen    string
	CacheSize int
}

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Server

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

func NewServer

func NewServer(cfg Config) (*Server, error)

func (*Server) LookupCache

func (s *Server) LookupCache(req *dns.Msg, net string) (*dns.Msg, bool)

func (*Server) LookupHosts

func (s *Server) LookupHosts(req *dns.Msg) (*dns.Msg, bool)

func (*Server) LookupNet

func (s *Server) LookupNet(req *dns.Msg, net string) (*dns.Msg, string, error)

LookupNet resolve the the dns request through net. The first return value is answer,iff it's nil means failed in resolving. Due to implementation, now the error will always be nil, but don't do this assumpation in your code.

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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