Iterative DNS resolver for Go (golang).
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
cmd/dnsr
.gitignore
LICENSE
README.md Update README + documentation. Jun 7, 2015
cache.go Remove redundant toLowerFQDN. Internal code assumes clean input. Jul 5, 2015
cache_test.go
generate.sh
go.mod
go.sum
logging.go
resolver.go
resolver_test.go
root.go
root_cache.go
rr.go
strings.go
strings_test.go Add test describing toLowerFQDN Aug 18, 2016

README.md

dnsr

build status godoc

Iterative DNS resolver for Go.

The Resolve method on dnsr.Resolver queries DNS for given name and type (A, NS, CNAME, etc.). The resolver caches responses for queries, and liberally (aggressively?) returns DNS records for a given name, not waiting for slow or broken name servers.

This code leans heavily on Miek Gieben’s excellent DNS library, and is currently in production use at Domainr.

Install

go get github.com/domainr/dnsr

Usage

package main

import (
  "fmt"
  "github.com/domainr/dnsr"
)

func main() {
  r := dnsr.New(10000)
  for _, rr := range r.Resolve("google.com", "TXT") {
    fmt.Println(rr.String())
  }
}

Documentation

Development

Run go generate in Go 1.4+ to refresh the root zone hint file. Pull requests welcome.

Copyright

© 2014–2015 nb.io, LLC