sdns: github.com/semihalev/sdns/middleware/hostsfile Index | Files

package hostsfile

import "github.com/semihalev/sdns/middleware/hostsfile"

Index

Package Files

hostsfile.go

type Hostsfile Uses

type Hostsfile struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

Hostsfile contains known host entries.

func New Uses

func New(cfg *config.Config) *Hostsfile

New return new hostfile, it will be hosts file also

func (*Hostsfile) LookupStaticAddr Uses

func (h *Hostsfile) LookupStaticAddr(addr string) []string

LookupStaticAddr looks up the hosts for the given address from the hosts file.

func (*Hostsfile) LookupStaticHostV4 Uses

func (h *Hostsfile) LookupStaticHostV4(host string) []net.IP

LookupStaticHostV4 looks up the IPv4 addresses for the given host from the hosts file.

func (*Hostsfile) LookupStaticHostV6 Uses

func (h *Hostsfile) LookupStaticHostV6(host string) []net.IP

LookupStaticHostV6 looks up the IPv6 addresses for the given host from the hosts file.

func (*Hostsfile) Name Uses

func (h *Hostsfile) Name() string

Name return middleware name

func (*Hostsfile) ServeDNS Uses

func (h *Hostsfile) ServeDNS(ctx context.Context, ch *middleware.Chain)

ServeDNS implements the Handle interface.

Package hostsfile imports 14 packages (graph) and is imported by 1 packages. Updated 2020-10-28. Refresh now. Tools for package owners.