resolve

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package resolve is used to handle resolving records It also handles wildcard subdomains and rotating resolvers.

Index

Constants

This section is empty.

Variables

View Source
var DefaultResolvers = []string{
	"1.1.1.1",
	"1.0.0.1",
	"8.8.8.8",
	"8.8.4.4",
	"9.9.9.9",
	"9.9.9.10",
	"77.88.8.8",
	"77.88.8.1",
	"208.67.222.222",
	"208.67.220.220",
}

DefaultResolvers contains the default list of resolvers known to be good

View Source
var DefaultResolversCN = []string{
	"223.5.5.5",
	"223.6.6.6",
	"119.29.29.29",
	"114.114.114.114",
	"114.114.115.115",
	"101.226.4.6",
	"117.50.11.11",
	"52.80.66.66",
	"1.2.4.8",
	"210.2.4.8",
}

DefaultResolversCN contains the default list of resolvers known to be good

Functions

func InitWildcards added in v0.0.5

func InitWildcards(r *Resolver, domain string, resolvers []string, maxWildcardChecks int) (error, map[string]struct{})

InitWildcards inits the wildcard ips array

Types

type HostEntry

type HostEntry struct {
	Host     string           `json:"host"`
	Source   string           `json:"source"`
	IpPorts  map[string][]int `json:"ip_ports"`
	CNames   []string         `json:"cnames"`
	TakeOver bool             `json:"take_over"`
}

HostEntry defines a host with the source

type ResolutionPool

type ResolutionPool struct {
	*Resolver
	Tasks   chan HostEntry
	Results chan Result
	// contains filtered or unexported fields
}

ResolutionPool is a pool of resolvers created for resolving subdomains for a given host.

type Resolver

type Resolver struct {
	DNSClient *dnsx.DNSX
	Resolvers []string
}

Resolver is a struct for resolving DNS names

func New

func New() *Resolver

New creates a new resolver struct with the default resolvers

type Result

type Result struct {
	Type   ResultType
	Host   string
	IP     string
	Error  error
	Source string
}

Result contains the result for a host resolution

type ResultType

type ResultType int

ResultType is the type of result found

const (
	Subdomain ResultType = iota
	Error
)

Types of data result can return

Jump to

Keyboard shortcuts

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