iran_ban_resolver

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 15 Imported by: 0

README

iran_ban_resolver

iran_ban_resolver is a coredns plugin to that resolves banned domains from trusted DNS servers(like Shekan and Electro) to their real IPs.

config

example:

iran_ban_resolver {
        reload 500ms
        hosts ./hosts_dir/hosts-ban
        resolve-from 78.157.42.101:53
    }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IranBanResolver

type IranBanResolver struct {
	sync.RWMutex

	Next plugin.Handler
	// contains filtered or unexported fields
}

IranBanResolver is a coredns plugin to resolve banned domains in iran.

func New

func New() *IranBanResolver

func (*IranBanResolver) Name

func (ibr *IranBanResolver) Name() string

Name implements the Handler interface.

func (*IranBanResolver) OnShutdown

func (ibr *IranBanResolver) OnShutdown() error

OnShutdown stops all configured clients.

func (*IranBanResolver) OnStartup

func (ibr *IranBanResolver) OnStartup() (err error)

OnStartup starts a goroutines for all clients.

func (*IranBanResolver) ServeDNS

func (ibr *IranBanResolver) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface. This method gets called when iran_resolver is used in a Server.

Jump to

Keyboard shortcuts

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