aboutsummaryrefslogtreecommitdiff
path: root/middleware/file (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 38-5095/+0
* 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-08-25core: block CH queries earlier (#973)Gravatar Miek Gieben 1-4/+0
block chaos queries, unless the chaos or proxy middleware is loaded. We respond with REFUSED. This removes the need for each middleware to do this class != ClassINET if-then. Also make config.Registry non-public.
2017-08-22mw/*: updates docs about upstream (#968)Gravatar Miek Gieben 1-1/+2
Upstream allows file structured like /etc/resolv.conf. Update docs. Fixes #709
2017-08-21mw/file: add include test (#960)Gravatar Miek Gieben 1-0/+32
$INCLUDE was fixed in miekg/dns, create tests in CoreDNS so that we know we have the latest version. Fixes #880
2017-08-19Dns.join (#944)Gravatar Miek Gieben 1-2/+2
* Add dnsutil.Join * Create dnsutil.Join Create Join helper function and move bits in the code over.
2017-08-16tests: add SortAndCheck helper (#926)Gravatar Miek Gieben 9-259/+14
There was quite some code duplication in a lot of tests to check if an answer was considered Ok. Created a test.SortAndCheck helper function that takes care of this.
2017-08-14mw/kubernetes: remove federation and cidr (#916)Gravatar Miek Gieben 1-0/+2
* mw/kubernetes: remove federation and cidr Remove both as we have a corefile syntax change that handles cidr and remove federation because that is going to be its own middleware. * backwards incompat changes This PR: * removes cidr from kubernetes (core Corefile feature now) * removes federation from kubernets (comes back as new middleware) * [remove autopath - which was already gone, so that already was backwards incompat] * adds `fallthrough` to the *etcd* middleware and makes you enable it. * Fail on unknown properties * documentation * Disable TestHealthCheck as it uses realtime and fails
2017-08-13cidr everywhere: check all middleware (#915)Gravatar Miek Gieben 1-0/+5
* cidr everywhere: check all middleware Add tests for cidr in only that middleware that already tests for this. Check the other ones manually (and put reverse in the tests cases anyway). Make etcd setup_test run without +build etcd tag - it is not needed for this test - move rest of the code to lookup_test.go. Cleanup proxy test a bit and remove TempDir as there is test.TempFile that does the same thing. Fixes #909 * coredns package * Fix test compile
2017-08-10core: small cleanup (#877)Gravatar Miek Gieben 1-59/+57
Add some docs about normalize.Host and normalize.Name. They are used correctly in the middleware even though they are somewhat confusing, esp when you copy from ServerBlockKeys in your middleware.
2017-08-06all: gometalinter (#843)Gravatar Miek Gieben 2-4/+4
* kubernetes/reverse: remove deadcode * deadcode in errors and kubernetes removed * unnecessary conversion * constants * proxy: time.Since() * simplications * static check * Disable test/external_test
2017-08-06middleware/secondary: add jitter (#841)Gravatar Miek Gieben 1-0/+14
randomize the times when doing transfers and checks. Fixes #840
2017-08-04golint cleanup (#828)Gravatar Yong Tang 1-0/+1
Clean up some golint related issues. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-04Misspell correction (#826)Gravatar Yong Tang 1-1/+1
Did a `misspell . | grep -v ^vendor` and fixed several typos. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-07-24middleware/file: fix multiple wildcards (#787)Gravatar Miek Gieben 2-6/+71
Don't hold on to the *first* wildcard you'll find, but keep searching, there may be one even deeper in the tree. Also add multi level wildcard test Fixes #776
2017-07-21mw/file: wildcard at apex fix (#785)Gravatar Miek Gieben 1-0/+61
* mw/file: wildcard at apex fix This adds a test case (that does passes!) * completer test
2017-06-21middleware/secondary: multiple fixes (#745)Gravatar Miek Gieben 5-11/+26
Fix transferring the zone from a master and the matching of notifies to source and dst IP addresses. Add `upstream` keyword as well, because it is needed for the same reasons as in the *file* middlware. Add some dire warning about upstream in the readme of both middlewares. Out of band testing, hidden by net build tag was added. Integration testing still needs to be setup.
2017-06-18mw/file: rename to BenchmarkFileLookup (#741)Gravatar Miek Gieben 3-3/+3
In grafana we miss the context of where this is called, make the name more descriptive. Also test the GH webhook.
2017-06-14cleanup: go vet and golint run (#736)Gravatar Miek Gieben 2-3/+3
* cleanup: go vet and golint run Various cleanups trickered by go vet and golint. * Fix tests and lowercase all errors Lowercase all errors, some tests in kubernetes use errors from kubernetes which do start with a capital letter.
2017-06-13middleware/file: consider no SOA a fatal error (#734)Gravatar Miek Gieben 2-1/+24
Don't load a zone with a SOA record, barf with 'no SOA record' error.
2017-06-08middleware/file: don't reload zone when SOA isn't changed (#707)Gravatar Miek Gieben 18-77/+118
* middleware/file: don't reload zone when SOA isn't changed Give Parse an extra argument which is the SOA's serial, if > 0 we check against the just parsed SOA and then just return. Most notable use is in reload.go which is both used in the file and auto middleware. Fixes #415 * PR comments
2017-06-02middleware/file: add DNSSEC support (#697)Gravatar Miek Gieben 2-2/+182
* middleware/file: add DNSSEC support Add tests for DNSSEC and check if everything is working. * add signatures * tweak * Add DNSSEC signing tests for DNAME * Just sign it all
2017-06-01middleware/secondary: fix crash with no zone (#680)Gravatar Miek Gieben 1-0/+8
When CoreDNS starts up and can't get a zone transfer going the Apex is empty. This `nil` is then transformed into wireformat, which fails with a nil pointer dereference in Go DNS. In this case we should just return SERVFAIL, because we don't have any info (yet). Note the lookup code returned NXDOMAIN, which is correct from a lookup standpoint, but also invalidates every name in the future loaded zone. Anyway, look for an apex before doing the lookup and return SERVFAIL if nothing is found. Fixes #679
2017-05-26middleware/file: add DNAME support (#651)Gravatar Eric Yan 3-2/+222
* Test DNAME handling If the DNAME itself matches the QTYPE, and the owner name matches QNAME, the relevant DNAME RR should be included in the answer section. Other parts of RFC 6672 are not implemented yet and hence left untested. * Implement the DNAME substitution As specified in RFC 6672, a DNAME substitution is performed by replacing the suffix labels of the name being sought matching the owner name of the DNAME resource record with the string of labels in the RDATA field. The matching labels end with the root label in all cases. Only whole labels are replaced. * Handle DNAME redirection A CNAME RR is created on-the-fly for the DNAME redirection. Be aware that we do not have all the edge cases covered yet. * Test DNAME owner name matching the QNAME A DNAME RR redirects DNS names subordinate to its owner name; the owner name of a DNAME is NOT redirected itself. * Ignore names next to and below a DNAME record According to RFC 6672, resource records MUST NOT exist at any subdomain of the owner of a DNAME RR. When loading a zone, those names below the DNAME RR will be quietly ignored. * Streamline DNAME processing Instead of checking DNAMEs during lookup, we use a preloaded list of DNAME RRs to streamline the process without any runtime performance penalty: * When loading the zone, keep a record of any DNAME RRs. * If there aren't any DNAMEs in the zone, just do the lookup as usual. * Only when the zone has one or more DNAME records, we look for the matching DNAME and ignore confronting subdomain(s) in the process. * Make it easier to trace back through test errors * Make DNAME handling part of lookup routine DNAME processing is invoked only if the zone has at least one DNAME RR. * Put DNAME resolution inside the searching of a hit We can drop some of the other ideas; we don't need to track if we have DNAMEs in the zone it just follows naturally from the current lookup code. See also: #664
2017-05-03middleware/file: correctly parse the stanza (#658)Gravatar Miek Gieben 1-30/+32
* middleware/file: correctly parse the stanza Parsing the file stanza would give precedence to 'transfer' and ignore other bits if it wasn't specified. This change fixes the parsing. The actually external CNAME retrieval is working fine (once the upstream is correctly parsed). This wasn't caught in tests, because we lack a parsing test for this. Fixes #657 * Add tests
2017-02-22Fix import path `github.com/miekg/coredns` -> `github.com/coredns/coredns` ↵Gravatar Yong Tang 18-39/+39
(#547) This fix fixes import path from `github.com/miekg/coredns` -> `github.com/coredns/coredns`
2017-02-19middleware/file: additional section processing (#531)Gravatar Miek Gieben 2-3/+68
Add additional section processing for MX and SRV records. Update the tests.
2017-01-15middleware/proxy: implement Exchanger (#480)Gravatar Miek Gieben 2-2/+2
By defining and using an proxy.Exchanger interface we make the proxy more generic and we can then fold back httproxy into proxy. This overrides #463 and #473 and should make futures extensions rather trivial * Add docs that talk about `protocol` and how to set it. * middleware/proxy: rename New to NewLookup It's used as a Lookup mechanism not as a completely new proxy, reflect that in the name. * Set maxfails to 3 by default when looking up names. Most of the changes have been copied from https://github.com/johnbelamaric/coredns/pull/1/files
2016-12-20Add middleware.NextOrFailure (#462)Gravatar Miek Gieben 2-6/+7
This checks if the next middleware to be called is nil, and if so returns ServerFailure and an error. This makes the next calling more robust and saves some lines of code. Also prefix the error with the name of the middleware to aid in debugging.
2016-12-14middleware/file: include sigs in additional (#456)Gravatar Miek Gieben 2-5/+287
When asked for the NSset include glue and possible sigs in the additional section. Fixes #411
2016-12-09middleware/file: include nsset in repliesGravatar Miek Gieben 5-15/+57
This is required so that a resolver can upade the referral NSset with the NSset at the child. Update tests as well.
2016-11-24Use upstream parsing from master branch (#438)Gravatar Miek Gieben 1-7/+4
2016-11-24merge conflict fixedGravatar Miek Gieben 7-11/+131
2016-11-24middleware/proxy: config syntax cleanups (#435)Gravatar Miek Gieben 1-8/+10
* middleware/proxy: config syntax cleanups Allow port numbers to be used in the transfer statements and clean up the proxy stanza parsing. Also allow, when specifying an upstream, /etc/resolv.conf (or any other file) to be used for getting the upstream nameserver. Add tests and fix the documentation to make clear what is allowed. * Fix the other upstream parse as well
2016-11-24middleware/file: better notify error reportingGravatar Miek Gieben 1-1/+1
Report errors as originating from notifies in all cases. Fixes #412
2016-11-13Fix various issues with formatting and typos (#424)Gravatar Michael Grosser 2-3/+3
* Fix typos * Simplify code * Fix error usage
2016-11-10Remove some printlnsGravatar Miek Gieben 1-2/+0
2016-11-10Compile fixes and make it workGravatar Miek Gieben 2-1/+5
2016-11-10Implement external lookups for CNAMEsGravatar Miek Gieben 4-14/+36
2016-11-09middleware/{file, auto}: resolve external CNAMEsGravatar Miek Gieben 5-4/+99
Do the same thing as in etcd and give the option of externally resolving CNAME. This is needed when CoreDNS is a proxy as well is serving zones.
2016-11-09middleware/file: also react to rename events. (#406)Gravatar Miek Gieben 1-3/+1
* middleware/file: also react to rename events. * React to all events
2016-11-09middleware/file: Add CNAME chain support (#400)Gravatar Miek Gieben 4-16/+157
Up till now we would only chase 1 CNAME. Spec requires we will chase all. This PR add support for this. Up to 8 CNAMEs are chased (this could be longer, by just checking for cycles, but 8 seems enough for now). Also add RRSIG of the first CNAME for DNSSEC.
2016-11-08middleware/file: notify better error reportingGravatar Miek Gieben 1-3/+8
Slightly better errors reporting for failing to sent a notify.
2016-11-07middleware/file|auto: Notifies and AXFR (#399)Gravatar Miek Gieben 1-3/+6
Be more explicit in the logs when a notify fails. New notify error message looks like: 2016/11/07 18:21:42 [ERROR] Notify for zone "example.org." was not accepted by "8.8.8.8:53": rcode was "SERVFAIL" Correctly pick up secondaries When multiple secondary are specified make sure they are picked up. Fixes #393 #398
2016-11-07Issue 388 (#389)Gravatar Miek Gieben 1-4/+2
* add extra test * middleware/auto: fix crash when calling empty handler Don't call the next middleware, we should be auth. for this zone getitng into this path we should respond with ServFail. Fixes #388
2016-11-07Golint (#386)Gravatar Miek Gieben 1-10/+14
Lint and vet the curret code add docs about adding a git post-commit hook that performs these actions after each commit.
2016-11-06middleware/file: add nsec for wildcard expansion (#382)Gravatar Miek Gieben 4-10/+34
A NSEC record is need to deny any other name that might exist. Also don't blindly perform the interface conversion when getting glue for NS records as they now may include RRSIG - also add tests for that.
2016-11-05middleware/file: fix delegations (#376)Gravatar Miek Gieben 16-596/+627
Fix the delegation handling in the *file* and *dnssec* middleware. Refactor tests a bit and show that they are failling. Add a Tree printer, cleanups and tests. Fix wildcard test - should get no answer from empty-non-terminal
2016-10-28middleware/file: reload on file mv (#365)Gravatar Miek Gieben 2-5/+17
When a file is moved into position we should also reload the zones' content. This also fixes deadlock bug in the locking, a reload would block any further lookups.
2016-10-27middleware/file: add test for reload (#361)Gravatar Miek Gieben 2-2/+22
This add a highlevel integration test for zone reloading. It also fixes a data race in the actual reloading process.
2016-10-27golintGravatar Miek Gieben 1-0/+1