* Rename middleware to plugin
first pass; mostly used 'sed', few spots where I manually changed
text.
This still builds a coredns binary.
* fmt error
* Rename AddMiddleware to AddPlugin
* Readd AddMiddleware to remain backwards compat
Check for a nil message and if we have a question section. Request is
usually called with an external Msg that already saw validation checks,
but we may also call it from message we create of our own, that may or
may not adhire to this. Just be more robust in this case.
This PR reverts a previous commit that was applied to master.
* Add unit tests & cnames
* more progress
* fix
* next mw dependent unit tests
* add tests for OnNXDOMAIN
* Add AAAA and ndots unit tests; fix request.NewWithQuestion
* Correct default value in README
* add CNAMEs to readme
* review
* fix autopath examples
* fix and test CNAME response order
Fix the unknown flags handling when receiving such message. We should
zero out all of the Z bits in the OPT record before returning.
Current behavior:
dig +norec +noad +ednsflags=0x80 soa miek.nl @deb.atoom.net
...
; EDNS: version: 0, flags:; MBZ: 0080 , udp: 4096
New:
dig +norec +noad +ednsflags=0x80 soa miek.nl @localhost -p 2053
...
; EDNS: version: 0, flags:; udp: 4096
Take care no to overwrite the Do bit.
We still accept *all* EDNS option; I do not consider that a bug in
itself.
Fixes#306
Cleanup the errors and removed deadcode along the way. The leaves
some error laying around, mostly about commenting exported identifier.
We should look hard if those really are needed.
Move all (almost all) Go files in middleware into their
own packages. This makes for better naming and discoverability.
Lot of changes elsewhere to make this change.
The middleware.State was renamed to request.Request which is better,
but still does not cover all use-cases. It was also moved out middleware
because it is used by `dnsserver` as well.
A pkg/dnsutil packages was added for shared, handy, dns util functions.
All normalize functions are now put in normalize.go