Commit graph

18 commits

Author SHA1 Message Date
Miek Gieben
885e6e8246 Allow more than 1 address for transfer (#121)
No reason why not to allow more then one address:
`transfer to 127.0.0.1 10.240.20.1`.

Fix startup as well, as it turned out to be broken...
2016-04-14 19:57:39 +01:00
Miek Gieben
5a8a125399 Failed startup was not flagged (#118)
The error propagation from srv.ListenAndServe did not work as intended,
simplified it a bit and added a test for it.
2016-04-13 20:13:55 +01:00
Miek Gieben
0ea2a6088d Add TestServer (#102)
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
2016-04-10 18:50:11 +01:00
Miek Gieben
db98cd4e4b Use *dns.Server (#99)
This does not fix the reload issue, but will give us flexibility
to access the packetConn and listener to make this all work.
2016-04-09 22:53:39 +01:00
Miek Gieben
49f994fa80 Dont log per qtype - fun and all, but not really useful 2016-04-09 17:42:31 +01:00
Miek Gieben
ad221f4b2a correct EDNS responses (#96)
Tests updated as well and all the middleware. And Prometheus renamed to
metrics (directive is still prometheus).
2016-04-09 16:17:53 +01:00
Miek Gieben
db3d689a8a EDNS: return error on wrong version. (#95)
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.
2016-04-09 11:13:04 +01:00
Miek Gieben
225cdd1ca3 Add AXFR test
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.
2016-04-06 22:29:33 +01:00
Miek Gieben
b9a6518bb0 use dropped for this metric 2016-04-06 15:51:06 +00:00
Miek Gieben
7e05aa8069 Enable monitoring for non middleware
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
2016-04-06 14:13:29 +01:00
Miek Gieben
6445a3f2f0 Cleanup docs and the chaos middleware
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.
2016-04-04 15:45:17 +01:00
Miek Gieben
3b25bfd7ae Fix Corefile parsing
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
2016-04-03 15:52:23 +01:00
Miek Gieben
4a2a95561f Answer REFUSED when we don't host the zone
Change from SERVFAIL to diff. between error and no such zone hosted.

Fixes: #68
2016-04-02 18:11:56 +01:00
Miek Gieben
47fca9a8fc Proxy cleanups
Remove things not supported, fix docs.
2016-03-19 20:53:37 +00:00
Miek Gieben
ec84cb1270 Random fixes and make servfail the special return code 2016-03-19 20:17:44 +00:00
Miek Gieben
33f00b5a3a Fix failing on startup
When we cannot bind to the port, return an error which will make
CoreDNS fail startup. Still a bit hackish, but good enough.
2016-03-19 19:38:54 +00:00
Miek Gieben
f907311cdf Use context.Context
Rename the old Context to State and use context.Context in the
middleware for intra-middleware communication and more.
2016-03-19 07:32:50 +00:00
Miek Gieben
3ec0d9fe6b First commit 2016-03-18 20:57:35 +00:00