Git Product home page Git Product logo

dnsr's Introduction

dnsr

build status pkg.go.dev

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())
  }
}

Or construct with dnsr.NewExpiring() to expire cache entries based on TTL.

Documentation

Development

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

Copyright

© nb.io, LLC

dnsr's People

Contributors

bookmoons avatar case avatar cee-dub avatar connyay avatar dependabot-preview[bot] avatar dependabot[bot] avatar domainrbot avatar maticmeznar avatar philpennock avatar rdoorn avatar wbond avatar ydnar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.