iran_resolver

package module
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 16 Imported by: 0

README

iran_resolver

iran_resolver is a coredns plugin to generate hosts file for banned and sanctioned urls. It's useful to create something liked https://shecan.ir/; A DNS server witch resolve banned and sanctioned urls with ur custom server ip

config

example:

iran_resolver {
    dns-to-check 78.157.42.101:53 10.202.10.202:53  # Reqiered

    sanction-search develop.403 electro
    ban-search 10.10.34.35

    sanction-hosts-file /etc/hosts_dir/hosts-sanction
    ban-hosts-file /etc/hosts_dir/hosts-ban

    result-hosts-file /etc/hosts_dir/hosts-ir

    sanction-dest-server-ips 10.10.10.10 20.20.20.20 # Reqiered
    ban-dest-server-ips 40.40.40.40 30.30.30.30 # Reqiered

    sanction-buffer-size 10
    ban-buffer-size 10
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IranResolver

type IranResolver struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

IranResolver is a coredns plugin to generate hosts file for banned and sanctioned urls.

func New

func New() *IranResolver

func (*IranResolver) Name

func (ir *IranResolver) Name() string

Name implements the Handler interface.

func (*IranResolver) OnShutdown

func (ir *IranResolver) OnShutdown() error

OnShutdown stops all configured clients.

func (*IranResolver) OnStartup

func (ir *IranResolver) OnStartup() (err error)

OnStartup starts a goroutines for all clients.

func (*IranResolver) ServeDNS

func (ir *IranResolver) 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