Commit graph

3613 commits

Author SHA1 Message Date
Miek Gieben
bba63f7765 Update readme as well 2016-04-28 10:44:47 +00:00
Miek Gieben
2d71f94aef metrics port should be 9153 2016-04-28 09:43:18 +00:00
Miek Gieben
2700eece2e pprof middleware (#138)
Add pprof middleware, enabled by pprof directive.
2016-04-28 10:26:58 +01:00
Miek Gieben
7a8d943bcc Bail out on failure when starting up
Don't silently hide failures, barf on startup. Also add more integration
tests that should catch some of these things.
2016-04-27 10:48:22 +00:00
Miek Gieben
efd5135ee3 Some tiny changes and new benchmark test function (#136) 2016-04-26 20:45:29 +01:00
Miek Gieben
1aa1a92198 Add middleware/dnssec (#133)
This adds an online dnssec middleware. The middleware will sign
responses on the fly. Negative responses are signed with NSEC black
lies.
2016-04-26 17:57:11 +01:00
Miek Gieben
8e6c690484 README updates 2016-04-24 08:11:00 +01:00
Miek Gieben
40b6774acc Metrics lost 'dns' subsystem
Local variable shadowing in global const. Now subsystem is back to
'dns'.
2016-04-22 07:11:25 +01:00
Miek Gieben
b1b5242650 Fix rewrite 2016-04-21 22:02:26 +01:00
Miek Gieben
a412255ad1 middleware/cache: Add metrics (#132)
Add prometheus metrics to the cache handler. This just used prometheus,
if the metrics middleware does not setup the handler, there is nobody
reading these metrics, but they are still reported. Seems the simplest
solution while keeping the whole middleware separation in tact.
2016-04-21 21:46:58 +01:00
Miek Gieben
e5e0cde08f Fix travis.yml (#129)
Also fix failing test in setup/error.
2016-04-21 14:26:02 +01:00
Miek Gieben
f5e29c14d3 log more for no-such-zone 2016-04-21 09:00:02 +00:00
Miek Gieben
5de2f87303 Better structured readme 2016-04-20 12:46:24 +00:00
Miek Gieben
b46bc89a21 etcd build is broken 2016-04-19 23:03:41 +01:00
Miek Gieben
e726dca2ee Fix error reporting (#128)
Put error back in the correct place in the directives.go. Also don't
make it a pointer. If it *is* a pointer the buildstack function does
not correctly set the Next Handler. Don't understand *why* this is
different from Caddy. Anyway this fixes it, with the caveat that
the error log file is now openend earlier in the startup.

Fixes #127
2016-04-19 22:51:23 +01:00
Miek Gieben
a1e6cb7cf4 middleware/etcd: Use the correct endpoint
The endpoint for etcd as wrongly set if a proxy was configured.
Clean up some documentation in the process as well.
2016-04-19 12:52:05 +00:00
Miek Gieben
913cffd4a8 Updates to README 2016-04-19 10:26:29 +00:00
Miek Gieben
10db2a80df Cache (#126)
* Add middleware/cache

Add a caching middleware that caches nxdomain, nodata and successful
responses. It differentiates between DNSSEC on normal DNS replies.

Each reply is compress and scrubbed so it will fit the specific client
asking for it.

* first simple test, less exporting of stuff

* more

* Add middleware/cache

Add a caching middleware that caches nxdomain, nodata and successful
responses. It differentiates between DNSSEC on normal DNS replies.

Each reply is compressed and scrubbed so it will fit the specific client
asking for it. The TTL is decremented with the time spend in the cache.
There is syntax that allows you to cap the TTL for all records, no
matter what. This allows for a shortlived cache, just to absorb query
peaks.

+Tests

* cache test infrastructure

* Testing
2016-04-19 11:13:24 +01:00
Miek Gieben
4e3c82bec5 CNAMEs targets should be in answer section.
A target of a cname must be put in the answer section. Fix this and add
a AAAA test for quad-AAAA CNAME responses.

Fixes #125
2016-04-16 17:55:11 +01:00
Miek Gieben
dfe5cae114 More delegation tests 2016-04-16 16:24:15 +01:00
Miek Gieben
e294c95582 middleware/file: Support delegations (#124)
Return a delegation when seeing one while traversing the tree in
search of an answer.

Put the SOA and NS record in the zone.Apex as these are to be handled
somewhat special.

Lowercase record on insert to make compares easier. This lowercases
all RR that have domain names in their rdata as well.
2016-04-16 16:16:52 +01:00
Miek Gieben
f783634174 Send notifies after reload 2016-04-15 20:29:32 +01:00
Miek Gieben
95477fd2fe Dont crash on tests with etcd running 2016-04-15 20:22:37 +01:00
Miek Gieben
a4bf01e1ee Clean paths 2016-04-15 20:14:04 +01:00
Miek Gieben
dcd05032a4 Watch the entire directory
Instead of watching a single file watch the entire directory and
catch the .Name from the event. On any event, just reload the damn
thing. This also fixes the problem of loosing events when the inode
changes.
2016-04-15 20:00:17 +01:00
Miek Gieben
aa0ba0c3b4 Re-add the watcher 2016-04-15 17:09:01 +00:00
Miek Gieben
9b82cca9e2 Fix parsing of transfer lines 2016-04-15 17:08:31 +01:00
Miek Gieben
c9d8a57ed6 Reload zone when a write is detected (#122)
Zone reloading
2016-04-15 14:26:27 +01:00
Miek Gieben
29ad957a9d Fix build 2016-04-14 21:29:01 +01:00
Miek Gieben
fb3286983b Do the notifies only once during startup 2016-04-14 21:22:12 +01:00
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
eb1f21bfff Drop NSEC3 zone (#120)
Error out when parsing and transferring such a zone. If we would serve
it we would give out the wrong answers, leading to (probably) validation
failures...

Fixes #114
2016-04-14 07:33:03 +01:00
Miek Gieben
ec343ce0ce Fix metrics README
Fixes #109
2016-04-14 07:00:16 +01:00
Miek Gieben
8184328dba Use IsDomainName (#119)
Liberal as it as it still has its use. Reject invalid domain names
in the config.

Unrelated: clear up the README as well. And fix travis script.
2016-04-13 23:23:35 +01:00
Miek Gieben
da447e28f4 Add Dockerfile (#116)
Add some docker bits and a Makefile.
2016-04-13 20:14:13 +01:00
Miek Gieben
982377516b Only transfer a zone once (#117)
Use sync.Once to only transfer a zone once.

Fixes #115
2016-04-13 20:14:03 +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
c3f8bb3735 Fix default address typo in health README 2016-04-13 10:19:09 +00:00
Miek Gieben
e979acba1b Implement NS queries to Etcd middleware
Copy and port the NS record stuff from SkyDNS. Slightly cleaner
implementation.
2016-04-13 08:03:56 +01:00
Miek Gieben
a441f93e0c Fix NODATA/NXDOMAIN for unknown types in etcd (#113)
* Finish the nodata stuff. See issue #9
* middleware/etc: add response to SOA queries
* Remove and add a few TODOs
2016-04-12 23:26:46 +01:00
Miek Gieben
25cf16af0e Use dns.IsSubDomain (#112)
For the match function use the proper thing from go dns. Fix all
callers and tests to use this.

Fixes: #107
2016-04-12 22:34:44 +01:00
Miek Gieben
842953f179 oops forget to checkin (#111) 2016-04-12 21:50:01 +01:00
Miek Gieben
9ee41a399a Add stub cycle test (#110) 2016-04-12 21:45:25 +01:00
Miek Gieben
27ff83e70f Stub forward/proxy tests (#108)
Test the handling of EDNS0 payloads and forwarding to stubzones
servers.
2016-04-12 21:30:08 +01:00
Miek Gieben
9f651a397b All (non etcd) tests are now local (#105)
We don't need to network to do tests, we up enough local servers
to we don't need to forward to,s say 8.8.8.8
2016-04-11 15:56:22 +01:00
Miek Gieben
31ce53f514 better (#104) 2016-04-11 10:22:27 +01:00
Miek Gieben
fed51ea373 Clean up some references to Caddy
Simple rename of Caddy/CoreDNS and some smallish cleanups.

See #1
2016-04-11 07:59:30 +01:00
Miek Gieben
4829b40efa Rename middleware/testing (#103)
Rename to test and name the toplevel tests dir to test for consitency.
2016-04-11 07:56:38 +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