Add a fullblown testing server. This allows us to do integration tests.
Also add a basic proxy test. Further tests will test etcd proxy
and stub zone communication and other "wildish" configurations.
Redo the server startup, so we can access the ports it listens on when
it has started up (with dns.ActivateAndServer).
Extend the .travis file to download etcd and test for that as well.
Put integration tests in test dir
Split up the previous changes a bit. This PR only returns the expected
error when the received packet has the wrong EDNS version.
EDNS0 handling in the middleware needs a nicer abstraction, like
ReflectEdns() or something.
We should not check the port of the request, we *should* actually
normalize it to port 53 - as that will probably be the address of
the server. Still need to double check if this will work if the
axfr should actually be done from a different port. That will come
later, this is good enough for now.
Test shouldTransfer by upping a testserver and sending the SOA query.
Remove state from DefaultErrorHandler and just get it from the request.
Add more logging to show what is going on.
This also adds the infrastructure for future tests.
If monitoring is enabled for one zone, also enable it for when the
server reports REFUSED. Normally the metrics are only enabled if
you enter the middleware, with this you'll see REFUSED queries.
Each of these are reported agains the root zone otherwise
For prometheus use the plain value, not a pointer and change all usages.
Allow AXFR to be requested over udp as well and some other more log
printed when commencing an AXFR.
Respond to notifies and allow a secondary to follow the SOA parameters
to update a zone from a primary. Also sprinkle it with logging.
Also extend monitoring to include qtype in more metrics.
Make the CH middleware actually work. Needs a bit of a hack to route
the fake version.bind and friends zone to the correct handler. Fiddle
with the order in directive.go so that CH queries get logged as well.
Secondly add class rewriting to the rewrite middleware handler and also
log the class by default.
Cache the size and the do bit whenever someone asked for it. We can
probably add more:
PASS
BenchmarkStateDo-4 100000000 11.9 ns/op
BenchmarkStateSize-4 5000000 265 ns/op
ok github.com/miekg/coredns/middleware 2.828s
PASS
BenchmarkStateDo-4 1000000000 2.86 ns/op
BenchmarkStateSize-4 500000000 3.10 ns/op
ok github.com/miekg/coredns/middleware 5.032s
This PR also includes some testing cleanups as well.
Fix some file/secondary issues when parsing a Corefile, also allow
for multiple origins to be specified. Also don't fail on startup when
a zonetransfer fails.
Fixes: #54
Allow specifying a primary server and retrieve the zone's content.
Add tests and an Expired bool to zone struct, to stop server zones
that are expired. The zone is retrieved on Startup, no updates of
changed content are done. We also don't respond to notifies yet.
Drop the use of dns.RR when in fact the only thing we use is the name
and type of the RR. Cleans up a bunch of stuff and also stops the weird
making of dns.RRs just for a lookup. Should safe some memory as well.
Fixes: #66
When looking for a name in tree, return wether we got to a longer one -
if so we had an ent. Add tests + dnssec tests and refactor the tests as
well a bit.