Rename the constants to IP4arpa and IP6arpa (shorter and exported) and
make IsReverse return the type of the reverse zone which could be handy
for some callers.
Also add tests for IsReverse()
* core: allow all CIDR ranges in zone specifications
Allow (e.g.) a v4 reverse on a /17. If a zone is specified in such a
way a FilterFunc is set in the config. This filter is checked against
incoming queries.
For all other queries this adds a 'x != nil' check which will not impact
performace too much. Benchmark function is added as well to check for
this as wel.
Add multiple tests in tests/server_reverse_test.go.
Benchmark shows in the non-reverse case this hardly impact the speed:
~~~
classless:
pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4 1000000 1431 ns/op 16 B/op 1 allocs/op
pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4 1000000 1429 ns/op 16 B/op 1 allocs/op
master:
pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4 1000000 1412 ns/op 16 B/op 1 allocs/op
pkg: github.com/coredns/coredns/core/dnsserver
BenchmarkCoreServeDNS-4 1000000 1429 ns/op 16 B/op 1 allocs/op
~~~
* README.md updates
* 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
2017-09-14 09:36:06 +01:00
Renamed from middleware/pkg/dnsutil/reverse.go (Browse further)