dns

package
v0.0.0-...-1f9488a Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dns resolves ip addresses to hostnames

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStats

type CacheStats struct {
	// contains filtered or unexported fields
}

CacheStats defines metrics for the LRU

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver defines a DNS resolver

func NewDNSResolver

func NewDNSResolver(cfg *config.Config, statsdClient statsd.ClientInterface) (*Resolver, error)

NewDNSResolver returns a new resolver

func (*Resolver) AddNew

func (r *Resolver) AddNew(hostname string, ip netip.Addr)

AddNew add new ip address to the resolver cache

func (*Resolver) AddNewCname

func (r *Resolver) AddNewCname(cname string, hostname string)

AddNewCname add new cname alias to the cache

func (*Resolver) HostListFromIP

func (r *Resolver) HostListFromIP(addr netip.Addr) []string

HostListFromIP gets a hostname from an IP address if cached

func (*Resolver) SendStats

func (r *Resolver) SendStats() error

SendStats sends the DNS resolver metrics

Jump to

Keyboard shortcuts

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