dnscache

package module
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: BSD-3-Clause Imports: 6 Imported by: 3

README

OVERVIEW

Go Reference Go Report Card Go Build

paepcke.de/dnscache

  • 100 % api compatible with stdlib dns net package (100% api coverage for simple api) just plug&play
  • thread safe, memory efficient, low-latency, ignore (bungled) dns ttl and enforce caching for 24 hours
  • less than 350 LOC, 100 % pure golang, stdlib only, external dependency free, easy to use
  • see api.go for details

SHOWTIME

default golang resolver vs. dnscache ( latency / alloc )

goos: freebsd
goarch: arm
pkg: paepcke.de/dnsache/cmd/dnsbench
Benchmark_stdlib-4     	       1	10403693854 ns/op	21246312 B/op	  245988 allocs/op
Benchmark_dnscache-4   	     531	    2247311 ns/op	       0 B/op	       0 allocs/op
PASS

DOCS

pkg.go.dev/paepcke.de/dnscache

CONTRIBUTION

Yes, Please! PRs Welcome!

Documentation

Overview

package dnscache provides an example async and multithreaded map based dnscache

package dnscache ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanCache

func CleanCache()

CleanCache ...

func LookupAddr

func LookupAddr(addr string) ([]string, error)

LookupAddr ...

func LookupCNAME

func LookupCNAME(host string) (string, error)

LookupCNAME ...

func LookupHost

func LookupHost(host string) ([]string, error)

LookupHost ...

func LookupIP

func LookupIP(host string) ([]net.IP, error)

LookupIP ...

func LookupMX

func LookupMX(host string) ([]*net.MX, error)

LookupMX ...

func LookupNS

func LookupNS(host string) ([]*net.NS, error)

LookupNS ...

func LookupSRV

func LookupSRV(service, proto, name string) (string, []*net.SRV, error)

LookupSRV ...

func LookupTXT

func LookupTXT(host string) ([]string, error)

LookupTXT ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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