Commit graph

472 commits

Author SHA1 Message Date
Miek Gieben
d35394a8df middleware/caching: don't set TTL on OPT
When setting the TTL on all RR in the message we would also do this
for the OPT RR. This is wrong as the OPT RR does *not* have a TTL.
2016-05-22 19:43:58 +01:00
Miek Gieben
069b61ff15 Add systemd service example file 2016-05-03 09:00:25 +00:00
Miek Gieben
ef7cb7788f Add more features to the README 2016-05-01 11:12:07 +01:00
Miek Gieben
e34e414e7f Fix path for asset storage (#144)
Define locations for keys and secondary zones, 'n stuff.

Add a bunch of tests as well.
2016-04-30 21:56:43 +01:00
Miek Gieben
e635b4e773 middleware/proxy: multiple enhancements (#145)
Add port 53 in the proxy host if not specified.
Check if the host is actually an IP address (v4 or v6)
Remove the http headers and other TODOs
2016-04-30 15:54:41 +01:00
Miek Gieben
14b84ce02b pprof does not need to inject middleware 2016-04-29 22:04:22 +01:00
Miek Gieben
9e9d72655d Make middleware survive a restart (#142)
Make middleware that sets up a (http) handler survive a graceful
restart. We calls the middleware's Shutdown function(s). If restart
fails the Start function is called again.

* middleware/health: OK
* middleware/pprof: OK
* middleware/metrics: OK

All restart OK.
2016-04-29 07:28:35 +01:00
Miek Gieben
a1478f891d Fix graceful reload (#141)
Fix CoreDNS graceful reloading. This uses the same stuff as Caddy
(obviously), but extends it for UDP listeners as well. Also add to the
README that we *will* call Shutdown for middleware.

Fixes #4
2016-04-28 21:15:45 +01:00
Michael Richmond
e34280e7af Clean up remove caddy refs (#139)
* Changed reference to Caddy over to CoreDNS

* Removing references to caddy

* Fixed misleading error message to reference coredns

* Cleaning up references to caddy

* Adding clean and deps targets

Muscle memory is resulting in "make clean" commands.

* Adding test target to makefile

* More "Caddy" cleanup
2016-04-28 19:07:44 +01:00
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