Git Product home page Git Product logo

goresolver's Introduction

go-resolver

Build Status ISC License codecov GoDoc

A Golang DNSSEC validating resolver library implemented on top of miekg/dns.

This package implements DNS lookup functions that perform DNSSEC validation.

Implementation

When querying DNSSEC enabled zones, it performs a full verification of the resource records (RRs) included in the response and validates the chain of trust:

  • Requests the desired RRset (along with the corresponding RRSIG record)
  • Requests the DNSKEY records containing the public ZSK and public KSK (along with the RRSIG for the DNSKEY RRset)
  • Performs the cryptographic verification of the RRSIG of the requested RRset with the public ZSK
  • Performs the cryptographic verification of the RRSIG of the DNSKEY RRset with the public KSK
  • Checks the validity period of the RRSIG records

Following these cryptographic verifications, the package then validates the authentication chain by walking up the delegation chain, checking the public DNSKEY RRs against the DS records in each parent zone, up to the TLD zone. (For a more in-depth description of how DNSSEC works, see this guide.)

In case of any validation errors, the method returns a non-nil err value, and an empty result set.

goresolver does not yet implement denial of existence validation using NSEC or NSEC3 records.

Documentation

import "github.com/peterzen/goresolver"

result, err := resolver.StrictNSQuery("example.com.", dns.TypeMX)

if err != nil {
	// handle validation errors
}

goresolver.LookupIP can be used as drop-in replacement to net.LookupIP:

import "github.com/peterzen/goresolver"

ips, err := goresolver.LookupIP("www.example.com")

if err != nil {
	// handle validation errors
}

Installation

$ go get -u github.com/peterzen/goresolver

PRs for additional test cases covering less common DNSSEC setups are welcome and much appreciated.

More information

  • DNS Security Introduction and Requirements RFC4033

goresolver's People

Contributors

peterzen avatar hazcod avatar

Stargazers

Peter A. avatar

Watchers

James Cloos avatar  avatar

Forkers

admpub cyrill-k

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.