Commit Graph

4104 Commits

Author SHA1 Message Date
Spencer Comfort d8fbd0a755
Update actions & add go 1.19.x and 1.20.x to go workflow (#1414)
* Update actions

* Update go.yml

* Update go.yml

* Update go.yml
2023-02-02 19:52:49 +01:00
dnschecktool f8a185d39e
readme: add some very thankful users (#1415) 2023-01-22 16:52:13 +01:00
Kian-Meng Ang 0089167cae
Fix typos (#1413)
Found via `codespell -L ede,ans,te,crasher`
2023-01-14 08:19:09 +01:00
Ali Mosajjal fe20d5d323
Update edns.go (#1409) 2023-01-06 08:54:28 +01:00
Tom Thorogood 41a7730f43
Remove space between NextLabel func and doc comment (#1410)
This was mistakenly added in #1406.
2023-01-06 08:51:52 +01:00
Miek Gieben 4bd038eb76
Run gofmt -w -s *.go (#1408)
Signed-off-by: Miek Gieben <>

Signed-off-by: Miek Gieben <>
2023-01-05 07:53:57 +01:00
Sam Therapy caa3fe0583
edns: add missing dig options (#1389)
* edns: add missing dig options

Signed-off-by: Sam Therapy <>

* Apply suggested change

Signed-off-by: Sam Therapy <>

Signed-off-by: Sam Therapy <>
2023-01-05 07:53:34 +01:00
Miek Gieben 3b7e0b9bdd
NextLabel: document neg. offset will panic (#1406)
Fixes: #1404

Signed-off-by: Miek Gieben <>

Signed-off-by: Miek Gieben <>
2023-01-05 07:52:29 +01:00
Caleb Jasik 8c643eba82
Add slackhq/nebula to users (#1403)
This is currently used to provide DNS server capabilities to the nebula lighthouses.
2022-12-30 18:08:40 +01:00
Simon Elsbrock 16b12df562
fix: example in docs with invalid syntax (#1401)
fixes invalid syntax in one of the examples of the README
2022-11-12 12:38:48 +01:00
Mike Schinkel 4822b271aa
Restructure license so Github will recognize it. (#1397) 2022-11-12 12:37:31 +01:00
Miek Gieben b3dfea0715 Release 1.1.50 2022-06-21 10:38:26 +02:00
Miek Gieben 69924a02cf
Make tsigGenerateProvider/TsigVerifyProvider public (#1382)
Make it public as TsigGenerateWithProvider and update the docs a little.
And TsigVerifyWithProvider also - tweak those docs also a little.

Signed-off-by: Miek Gieben <>
2022-06-21 10:37:36 +02:00
João Oliveirinha ff611cdc4b
Add back support for *net.UnixCon with seqpacket type (#1378)
This was broken by PR:
2022-06-08 14:03:24 +02:00
Miek Gieben eb4745b695
Add more detail to NSEC packing errors (#1374)
Add 'in the type bitmap' to make clear where in the RR the error occurs.
Also use 'NSEC(3)' - as this code is shared between NSEC and NSEC3, the
first error used NSECx.

Technically backwards incompatible, but checking strings in errors as
bad practice (although this lib lacks library types).

See #1373

Signed-off-by: Miek Gieben <>
2022-05-27 11:01:25 +02:00
Shane Kerr 7413c83334
Disallow names that start with '.' in IsDomainName() (#1376)
* Disallow names that start with '.' in IsDomainName()

* Also update packDomain()
2022-05-26 15:06:08 +02:00
Miek Gieben 5521648610 Release 1.1.49 2022-05-10 18:51:11 +02:00
Shane Kerr bfcbf0fd23
Fix dohpath parsing/stringify (#1366)
* dohpath escaped in String(), and parsed such values

* Update the test for dohpath with escaping

* Fix cut & paste error with svcdohpath error
2022-05-10 18:40:32 +02:00
Shane Kerr feda877277
Properly parse alpn values in SVCB (#1363)
* Modify the SVCBAlpn to properly parse/print

* Remove debug

* Change SVCB test from reflect to loop

* Refactor SVCB code to reduce indentation

* When stringifying SVCBAlpn, use strings.Builder for whole process

* Update comment in svcb.go

Co-authored-by: Miek Gieben <>

* Describe why we use a specific size for the alpn buffer

Co-authored-by: Miek Gieben <>
2022-05-10 18:40:09 +02:00
Miek Gieben 0d2c95b99c
Upgrade our test Go version to 1.17 and 1.18 (#1369)
Signed-off-by: Miek Gieben <>
2022-04-15 10:16:27 +02:00
Miek Gieben c760d3c7f1
Fix examples by using net.JoinHostPort (#1368)
Small fix in the examples to properly work with v6 addresses.

Closes: #1365 #1367

Signed-off-by: Miek Gieben <>
2022-04-15 10:13:08 +02:00
Ainar Garipov 656b7409ac
Add notes about SVCB draft changes to SVCB-related API (#1364)
* Add notes about SVCB draft changes to SVCB-related API

* Decrease number of warnings, rephrase
2022-04-14 20:36:11 +02:00
Ainar Garipov 08c2616301
Add SVCB dohpath key (#1359)
* Add SVCB dohpath key

The parameter is being added in [its own IETF draft][1] and also being used in
the [IETF draft about Descovery of Designated Resolvers][2].

Additionally, the mappings of the numeric key values to strings are exported,
under names consistent with the already existing exported mappings, to make it
easier for the clients of the module to validate and print SVCB keys.

Testing was done by sending SVCB queries for the "" domain to
OpenDNS's server.


* Fix template length, docs; reverse some changes

* Remove incorrect validations; improve docs
2022-04-12 17:49:30 +02:00
Miek Gieben dedee46bd4
Fix ExamplePrivateHandle (#1354)
Signed-off-by: Miek Gieben <>
2022-04-02 19:16:31 +02:00
Miek Gieben 49c1b2e20f Release 1.1.48 2022-04-01 14:02:37 +02:00
Miek Gieben 045ac4ec6c
Fix RSAMD5 keytag calucation. (#1353)
Of course the wording was changed (for the better) in an errata:

We still followed the original RFC4034 text. Note I haven't given this
much thought, just changed the 2 into a 3 and ran the test.

Fixes: #1352

Signed-off-by: Miek Gieben <>
2022-04-01 14:01:47 +02:00
Olivier Poitrey 57e2e627a6
Invalid NSEC/3 bitmap on non-zero buffer (#1338)
* Invalid NSEC/3 bitmap on non-zero buffer

If the PackBuffer is used to encode an NSEC/3 record, the bitmap is
xored with the content of the buffer instead of being zeroed first.

The algorithm has been changed so it is able zero bytes without
losing too much performance (around 2x slower).

* Add some comments + rename some vars to make algo clearer

* Revert to previous algo with window length compute+0 on new window

* Use typeBitMapLen to compute the bitmap length to zero
2022-04-01 14:01:05 +02:00
DesWurstes 2f577ca35d
Update SVCB (#1341)
* Rename ECH, bump draft number

* AliasForm new treatment

* alpn is no longer mandatory by default

* Document the non-empty value requirement

* new test cases

* more test cases

* Continue forbidding v4-map-v6 but not v4-embed-v6 and

* Update documentation

* revert rename ech

* Reword AliasMode with key=value pairs
2022-04-01 14:00:53 +02:00
Miek Gieben d70eb7b9e1 Release 1.1.47 2022-03-12 10:49:06 +01:00
Dimitris Mavrommatis d48e92a0e6
Handle packing of empty RDATA correctly for EDNS0_EXPIRE (Resolves #1292) (#1293)
* Change EDNS_EXPIRE field to support zero length option data (Resolves #1292)

As per [RFC7134]( the Expire
Option in queries should be zero-length. In the current implementation the field is
uint32 which always instatiates 4bytes for that field when packing to wire format.
For that reason we change the field to []uint8 so it can support 0-length and 4-byte
length option data.

* addressed comments

* addressed comments

* make change backwards compatible

* add comment for Empty field
2022-03-12 09:42:42 +01:00
Miek Gieben 05140a3136
Add indentityHash for algos that don't need hashing (#1340)
This adds hash.go and creates a identityHash that is used for algorithms
that do their own hashing (ED25519) for instance.

This unifies the hash variable naming between dnssec and sig(0) signing
and removes the special casing that existed for ED25519.

This unifies the variable naming between sig(0) and dnssec signing and

I didn't want to used crypto.RegisterHash as not to fiddle with the
global namespaces of hashes, so the value of '0' from AlgorithmsToHash
is handled specially in dnssec and sig(0) code.

Note that ED448 isn't implemented at all.

Signed-off-by: Miek Gieben <>
2022-03-12 09:41:21 +01:00
Miek Gieben af1ebf55eb
Id check tests: stop using Exchange (#1343)
Using Exchange doesn't add anything, as it just wraps client.Exchange
with a default client.

Remove them and speed up the tests, goes from 3s to 1s (for the entire
test suite).

Signed-off-by: Miek Gieben <>
2022-03-02 13:52:49 +01:00
Miek Gieben 84af068d46 Release 1.1.46 2022-02-07 08:05:09 +01:00
Tom Thorogood 33e64002b6
Support TsigProvider for Server and Transfer (#1331)
Automatically submitted.
2022-02-05 00:23:49 +00:00
JeremyRand 51afb90ed3
Fix doc typo (#1328) 2022-01-17 08:58:28 +01:00
Tom Thorogood 0544c8bb11
Only treat a *net.UnixConn of unixgram as a packet conn (#1322)
* Refactor net.PacketConn checks into helper function

* Only treat a *net.UnixConn of unixgram as a packet conn

* Handle wrapped net.Conn types in isPacketConn

* Use Error instead of Fatal where appropriate in TestIsPacketConn
2021-12-28 13:52:38 +00:00
bshea3 af5144a5ca
Fix location of opt pseudosection and prevent empty additional section in dig-like output (#1320)
Automatically submitted.
2021-12-24 17:12:14 +00:00
Mark 32b1ed5f32
Add into list of users (#1319) 2021-12-24 08:09:22 +01:00
Miek Gieben 294c41a1d8 Release 1.1.45 2021-12-23 09:46:38 +01:00
Andrey Meshkov ba44371638
Fix edns keepalive (#1317)
* Fix un/packing of EDNS0 TCP keepalive extension

The current code is assuming the OPT code and length are part of the
data passed to the unpacker and that it should be appenedded during
packing while those fields are parsed by the caller.

This change fixes the parsing and make sure a request with a keepalive
won't fail.

* added tests for EDNS0_TCP_KEEPALIVE pack/unpack

* mark Length as deprecated

* removed named returns

* restored String

Co-authored-by: Olivier Poitrey <>
2021-12-23 09:45:02 +01:00
Miek Gieben f4af58267c Release 1.1.44 2021-12-21 09:32:39 +01:00
Chris O'Haver 3a58872b63
Do not sign BADKEY and BADSIG TSIG error responses (#1316)
* Per RFC 8945 5.3.2, responses with BADKEY and BADSIG errors must not be signed.

Signed-off-by: Chris O'Haver <>

* refactor to remove else block

Signed-off-by: Chris O'Haver <>

* skip signing only for BADKEY and BADSIG

Signed-off-by: Chris O'Haver <>
2021-12-20 10:31:57 +01:00
Konstantine 3b8982ccc6
fixed documentation for DefaultMsgAcceptFunc (#1308) 2021-10-15 09:02:59 +02:00
Tom Sellers 7318b01e11
APL: adjust error handling and tests (#1302) 2021-10-12 13:06:29 +02:00
Alexandru Ionut Tripon 1630ffe2ca
Added support for ENUM Source-URI Extension (#1301) 2021-09-27 15:50:21 +02:00
Johan Knutzen 4e8fe099f4
add fleetdeck project (#1298)
Co-authored-by: Johan Knutzen <>
2021-09-15 08:58:44 +02:00
Tom Thorogood df84acab71
Fix go generate missing required go.mod entry (#1290)
* Fix go generate missing required go.mod entry

There were no non-excluded files importing so it's
require was missing from go.mod. This caused the go run commands
invoked by go generate to fail.

tools.go is currently the recommended way to force non-build
dependencies to be retained by the go mod commands. If that changes in
the future, we can update then. As nothing from the import is actually
used, it won't impact anyone's build at all (except requiring an extra
download by the go tool which is unavoidable).

Pulling in the @master version of (which doesn't yet
have a stable release version) also updates a number of other
dependencies, but not quite to latest, so while I'm here just update
them all.

* Add explanatory comment and build tag to tools.go
2021-09-14 16:59:49 +02:00
Miek Gieben ab67aa6423
Fix race condition in ExchangeContext. (#1281)
Automatically submitted.
2021-08-04 16:16:52 +00:00
Manabu Sonoda af0c865ab3
fix Msg.Used TTL must be zero (#1280)
* fix Msg.Used RRset exists (value dependent -- with rdata) TTL must be zero

* Used(): change ttl using Header()
2021-07-18 09:24:05 +02:00
Aveline c23d8b3ce0
readme: add & (#1278) 2021-07-07 19:22:17 +02:00