dns

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const COMMON_DNS_PORT = 53

Variables

This section is empty.

Functions

func ParseDNSQuery

func ParseDNSQuery(p []byte) (string, string, error)

Types

type DnsCache

type DnsCache interface {
	// Query queries the response for the DNS request with payload `p`,
	// the response data should be a valid DNS response payload.
	Query(p []byte) []byte

	// Store stores the DNS response with payload `p` to the cache.
	Store(p []byte)
}

type FakeDns

type FakeDns interface {
	Start() error
	Stop() error

	// GenerateFakeResponse generates a fake dns response for the specify request.
	GenerateFakeResponse(request []byte) ([]byte, error)

	// QueryDomain returns the corresponding domain for the given IP.
	QueryDomain(ip net.IP) string

	// IsFakeIP checks if the given ip is a fake IP.
	IsFakeIP(ip net.IP) bool
}

type IPCache

type IPCache interface {
	Query(string) []net.IP
	Store(string, []net.IP, uint32)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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