Go
Latest commit 4744e91 Dec 9, 2016 @tmthrgd tmthrgd committed with Fix tcp6-tls support in (*Server).ListenAndServe(). (#427)
In the switch statement srv.Net is matched for tcp6-tls but
then compared against tcp6 within the case statement. This
causes tcp6-tls to be equivalent to tcp-tls and not specific
to tcp6. The `network = "tcp6"` line was previously unreachable.

This change corrects this and ensures tcp6-tls listens on IPv6
only.
Permalink
Failed to load latest commit information.
dnsutil Added new functions: TrimDomainName()/AddOrigin() Jan 25, 2016
idn tidyup a little with the latest golang.org/x/tools/cmd/vet Sep 30, 2015
.gitignore gitignore update Oct 15, 2013
.travis.yml Go 1.6 for travis Feb 22, 2016
AUTHORS add AUTHOR file Feb 10, 2014
CONTRIBUTORS Changed logic to typeswitch and added comments. Sep 20, 2014
COPYRIGHT Remove all copyright notices Sep 11, 2014
LICENSE Update the copy right for the original GO files May 12, 2013
README.md readme - add dockness to user list (#388) Oct 6, 2016
client.go Fix typos (#405) Oct 3, 2016
client_test.go Use t.Errorf in tests and make the error variable naming more consist… Jun 9, 2016
clientconfig.go A bunch of golint fixes Feb 19, 2015
clientconfig_test.go Lowercase all error msg from the tests Nov 26, 2015
dane.go Fix for miekg/dns issue #289: support the SMIMEA record (#410) Oct 17, 2016
defaults.go IsSubDomain docs Apr 12, 2016
dns.go Cleanup and removals (#377) Jun 13, 2016
dns_bench_test.go Seed math/rand with crypto/rand (#359) Jun 5, 2016
dns_test.go Remove reflection (#376) Jun 12, 2016
dnssec.go Remove reflection (#376) Jun 12, 2016
dnssec_keygen.go Refactor DNSSEC to use crypto.{PrivateKey,Signer} Aug 19, 2015
dnssec_keyscan.go Check input data for NewPrivateKey (#399) Oct 3, 2016
dnssec_privkey.go Refactor DNSSEC to use crypto.{PrivateKey,Signer} Aug 19, 2015
dnssec_test.go Lowercase all error msg from the tests Nov 26, 2015
doc.go Fix miek.nl post link (#414) Oct 17, 2016
dyn_test.go Remove all copyright notices Sep 11, 2014
edns.go support rfc7828 (#402) Nov 21, 2016
edns_test.go Simple function to clear the DO bit from an OPT resource record. (#407) Oct 5, 2016
example_test.go fix a stupid mistake "undefined: zone" Sep 30, 2015
format.go Remove WKS support Jun 5, 2016
fuzz_test.go Check for l.err in $INCLUDE Aug 8, 2015
generate.go Use t.Errorf in tests and make the error variable naming more consist… Jun 9, 2016
issue_test.go better comment Feb 28, 2016
labels.go Remove (most) reflection Jun 3, 2016
labels_test.go Remove (most) reflection Jun 3, 2016
msg.go Fix TXT RDATA parsing (#421) Dec 2, 2016
msg_generate.go Handle empty salt value (#392) Jul 26, 2016
msg_helpers.go Fix TXT RDATA parsing (#421) Dec 2, 2016
nsecx.go Cleanup and removals (#377) Jun 13, 2016
nsecx_test.go More test clean up Feb 26, 2015
parse_test.go Fix TXT RDATA parsing (#421) Dec 2, 2016
privaterr.go Skip reflection for most types (#369) Jun 12, 2016
privaterr_test.go Change VERSION private RR to use reserved space (#415) Oct 18, 2016
rawmsg.go Cleanup and removals (#377) Jun 13, 2016
remote_test.go Add remote test Aug 22, 2015
reverse.go Remove (most) reflection Jun 3, 2016
sanitize.go some memory optimisations Aug 31, 2015
sanitize_test.go Fix TXT RDATA parsing (#421) Dec 2, 2016
scan.go Always set tokenUpper when setting token (#403) Oct 3, 2016
scan_rr.go For consistency with other types, allow empty UINFO RDATA (#424) Dec 2, 2016
scanner.go Remove all copyright notices Sep 11, 2014
server.go Fix tcp6-tls support in (*Server).ListenAndServe(). (#427) Dec 9, 2016
server_test.go Add option in server to allow DNS over TLS Jan 8, 2016
sig0.go Use encoding/binary's conversion functions when possible. (#364) Jun 8, 2016
sig0_test.go Lowercase all error msg from the tests Nov 26, 2015
singleinflight.go Implement outstanding query detection. Aug 24, 2013
smimea.go Fix for miekg/dns issue #289: support the SMIMEA record (#410) Oct 17, 2016
tlsa.go Fix for miekg/dns issue #289: support the SMIMEA record (#410) Oct 17, 2016
tsig.go Cleanup and removals (#377) Jun 13, 2016
tsig_test.go TSIG: lowercase algorithm before use Mar 7, 2016
types.go Fix TXT RDATA parsing (#421) Dec 2, 2016
types_generate.go Kill all reflection when packing/unpacking RR (#372) Jun 12, 2016
types_test.go Fix for miekg/dns issue #289: support the SMIMEA record (#410) Oct 17, 2016
udp.go fix building on plan9 Mar 21, 2016
udp_linux.go Set UDP conn to non-blocking on Linux to fix Shutdown() Dec 1, 2015
udp_other.go fix building on plan9 Mar 21, 2016
udp_plan9.go fix building on plan9 Mar 21, 2016
udp_windows.go Export UDP interfaces Mar 9, 2015
update.go An update msg can have multiple, different prerequests and also multi… Feb 27, 2016
update_test.go For consistency with other types, allow empty UINFO RDATA (#424) Dec 2, 2016
xfr.go Small fix in docs for transfer Out Mar 28, 2016
xfr_test.go Lowercase all error msg from the tests Nov 26, 2015
zmsg.go Fix for miekg/dns issue #289: support the SMIMEA record (#410) Oct 17, 2016
ztypes.go Fix for miekg/dns issue #289: support the SMIMEA record (#410) Oct 17, 2016

README.md

Build Status

Alternative (more granular) approach to a DNS library

Less is more.

Complete and usable DNS library. All widely used Resource Records are supported, including the DNSSEC types. It follows a lean and mean philosophy. If there is stuff you should know as a DNS programmer there isn't a convenience function for it. Server side and client side programming is supported, i.e. you can build servers and resolvers with it.

We try to keep the "master" branch as sane as possible and at the bleeding edge of standards, avoiding breaking changes wherever reasonable. We support the last two versions of Go, currently: 1.5 and 1.6.

Goals

  • KISS;
  • Fast;
  • Small API, if its easy to code in Go, don't make a function for it.

Users

A not-so-up-to-date-list-that-may-be-actually-current:

Send pull request if you want to be listed here.

Features

  • UDP/TCP queries, IPv4 and IPv6;
  • RFC 1035 zone file parsing ($INCLUDE, $ORIGIN, $TTL and $GENERATE (for all record types) are supported;
  • Fast:
    • Reply speed around ~ 80K qps (faster hardware results in more qps);
    • Parsing RRs ~ 100K RR/s, that's 5M records in about 50 seconds;
  • Server side programming (mimicking the net/http package);
  • Client side programming;
  • DNSSEC: signing, validating and key generation for DSA, RSA and ECDSA;
  • EDNS0, NSID, Cookies;
  • AXFR/IXFR;
  • TSIG, SIG(0);
  • DNS over TLS: optional encrypted connection between client and server;
  • DNS name compression;
  • Depends only on the standard library.

Have fun!

Miek Gieben - 2010-2012 - miek@miek.nl

Building

Building is done with the go tool. If you have setup your GOPATH correctly, the following should work:

go get github.com/miekg/dns
go build github.com/miekg/dns

Examples

A short "how to use the API" is at the beginning of doc.go (this also will show when you call godoc github.com/miekg/dns).

Example programs can be found in the github.com/miekg/exdns repository.

Supported RFCs

all of them

  • 103{4,5} - DNS standard
  • 1348 - NSAP record (removed the record)
  • 1982 - Serial Arithmetic
  • 1876 - LOC record
  • 1995 - IXFR
  • 1996 - DNS notify
  • 2136 - DNS Update (dynamic updates)
  • 2181 - RRset definition - there is no RRset type though, just []RR
  • 2537 - RSAMD5 DNS keys
  • 2065 - DNSSEC (updated in later RFCs)
  • 2671 - EDNS record
  • 2782 - SRV record
  • 2845 - TSIG record
  • 2915 - NAPTR record
  • 2929 - DNS IANA Considerations
  • 3110 - RSASHA1 DNS keys
  • 3225 - DO bit (DNSSEC OK)
  • 340{1,2,3} - NAPTR record
  • 3445 - Limiting the scope of (DNS)KEY
  • 3597 - Unknown RRs
  • 403{3,4,5} - DNSSEC + validation functions
  • 4255 - SSHFP record
  • 4343 - Case insensitivity
  • 4408 - SPF record
  • 4509 - SHA256 Hash in DS
  • 4592 - Wildcards in the DNS
  • 4635 - HMAC SHA TSIG
  • 4701 - DHCID
  • 4892 - id.server
  • 5001 - NSID
  • 5155 - NSEC3 record
  • 5205 - HIP record
  • 5702 - SHA2 in the DNS
  • 5936 - AXFR
  • 5966 - TCP implementation recommendations
  • 6605 - ECDSA
  • 6725 - IANA Registry Update
  • 6742 - ILNP DNS
  • 6840 - Clarifications and Implementation Notes for DNS Security
  • 6844 - CAA record
  • 6891 - EDNS0 update
  • 6895 - DNS IANA considerations
  • 6975 - Algorithm Understanding in DNSSEC
  • 7043 - EUI48/EUI64 records
  • 7314 - DNS (EDNS) EXPIRE Option
  • 7553 - URI record
  • 7858 - DNS over TLS: Initiation and Performance Considerations (draft)
  • 7873 - Domain Name System (DNS) Cookies (draft-ietf-dnsop-cookies)
  • xxxx - EDNS0 DNS Update Lease (draft)

Loosely based upon

  • ldns
  • NSD
  • Net::DNS
  • GRONG