Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedQueryType = errors.New("unsupported query type")
)
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { NameByIP(ip []byte) (name string, found bool) IPByName(name string) (ip []byte, found bool) Add(name string, ip []byte) MarkFresh(name string, ip []byte) NextSequence() uint32 }
Cache defines the API for a cache of names to IPs and vice versa
func NewInMemoryCache ¶
type Server ¶
type Server interface { // LocalAddr() returns the address at which this server is listening LocalAddr() net.Addr // Serve() runs the server (blocks until server ends) Serve() error // Close closes the server's network listener. Close() error // ProcessQuery processes a DNS query and returns the response bytes, the number of answers in the response, and any error encountered while // processing the query. ProcessQuery(b []byte) ([]byte, int, error) // ReverseLookup resolves the given fake IP address into the original hostname. If the given IP is not a fake IP, // this simply returns the provided IP in string form. If the IP is not found, this returns false. ReverseLookup(ip net.IP) (string, bool) }
Server is a dns server that resolves queries for A records into fake IP addresses within the Class-E address space and allows reverse resolution of those back into the originally queried hostname.
Click to show internal directories.
Click to hide internal directories.