Documentation
¶
Overview ¶
Package dnscache provides process-wide cached DNS lookups: PTR records, forward (A/AAAA) records, and forward-confirmed reverse DNS (FCrDNS) composed from the two. Results — including failures — are cached in a shared LRU, and concurrent lookups for the same key coalesce via singleflight, so a given DNS fact costs at most one query per TTL.
Consumers: the parser's reverse_dns enricher (PTR only) and the MatchKnownBot (FCrDNS) and LookupHost (forward) expr helpers.
Index ¶
- func Configure(posTTL time.Duration, negTTL time.Duration, size int)
- func ForwardConfirmedNames(addr netip.Addr) []string
- func ForwardIPs(host string) []netip.Addr
- func ForwardLookup(host string) ([]netip.Addr, error)
- func PTRRecords(addr netip.Addr) []string
- func Purge()
- func SetResolver(r Resolver)
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForwardConfirmedNames ¶
func ForwardIPs ¶
func ForwardLookup ¶
ForwardLookup is ForwardIPs with the error of a failed lookup, which is cached with the empty result for the negative TTL.
func PTRRecords ¶
func SetResolver ¶
func SetResolver(r Resolver)
Types ¶
Click to show internal directories.
Click to hide internal directories.