Commit graph

8 commits

Author SHA1 Message Date
Miek Gieben
ab9efdcac4
Follow up on #1867 : use one map in backend_lookup (#1869)
Reduce map usage and combine two maps into one; add isDuplicate that
tests and adds to make things more readable.
2018-06-18 11:16:56 +01:00
Miek Gieben
26c41a0c17
plugin/file: fix local CNAME lookup (#1866)
* plugin/file: fix local CNAME lookup

Issue #1864 explains it will, when we serve the child zone as well we
should just recursive into ourself (upstream self). Thus relax the
IsSubDomain check in file/lookup.go and just query (even if the query
will hit a remote server).

I've looped over all other plugins that do something similar (CNAME
resolving) and they didn't do the IsSubDomain check; therefor I've
removed it from *file* as well.

Added test in file_upstream_test that shows this failed before but now
results in a reply.

Fixes #1864

* self does not need to be exported

* Fix test

We don't know if we had a valid reply. Check this.
2018-06-12 14:54:37 +01:00
Miek Gieben
6e466d5092 Remove dnsutil.Dedup (#1867)
Remove the code and remove the call in etcd and kubernetes handlers.
This does mean we should not add dups in the first place, which means
adding maps in backend_lookup to prevent dups from begin added.

This should cut down on the allocations because dnsutil.Dedup is very
expensive by converting everything to strings, we avoid doing that now.
2018-06-11 19:23:25 -07:00
Miek Gieben
5735292406
Do Compress only when need in request.Scrub (#1760)
* Remove Compress by default

Set Compress = true in Scrub only when the message doesn not fit the
advertized buffer. Doing compression is expensive, so try to avoid it.

Master vs this branch
pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-2   	   50000	     24774 ns/op

pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-2   	  100000	     21960 ns/op

* and make it compile
2018-05-01 21:04:06 +01:00
Miek Gieben
c0590e4ec4
plugin/etcd: small refactor (#1749)
* plugin/etcd: small refactor

I think this function can be smaller.

* and make it compile
2018-04-28 10:03:35 +01:00
Mario Kleinsasser
13b1f5469a Fix #1685 (#1700)
Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Create separate function for zone check

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Add tests for zone A records

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Remove pointer from checkZoneForRecord func signature, Add documentation

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Change apex to zone, Update readme information, Add additional tests

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Change zone to apex

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Change readme to reflect apex change

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Correct code comment

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>

Correct string join for apex.dns

Signed-off-by: Mario Kleinsasser <mario.kleinsasser@gmail.com>
2018-04-27 19:36:58 +01:00
Miek Gieben
2c80551fdc
plugin/{kubernetes/etcd}: dynamic SOA (#1188)
Add a dynamic SOA record (at least the serial and minttl). This create
another interface that should be implemented by the backends.

For now default to returning epoch in as a uint32 (no change from
before).

Lower the minTTL returned to 30s (from 60s)
2017-11-01 10:11:34 +00:00
Miek Gieben
d8714e64e4 Remove the word middleware (#1067)
* 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-09-14 09:36:06 +01:00
Renamed from middleware/backend_lookup.go (Browse further)