mirror of
https://github.com/coredns/coredns.git
synced 2025-11-13 23:42:40 -05:00
This middleware acts in the same way as SkyDNS. We might add options
to allow it to be behave different, but for now it will suffice.
A Corefile like:
.:1053 {
etcd miek.nl
proxy . 8.8.8.8:53
}
will perform lookup in etcd and proxy everything not miek.nl to Google
for further resolution.
The internal etcd forwarding *also* uses the proxy infrastructure,
meaning you get health check and such for (almost) free
14 lines
331 B
Go
14 lines
331 B
Go
package etcd
|
|
|
|
import "testing"
|
|
|
|
func TestPath(t *testing.T) {
|
|
for _, path := range []string{"mydns", "skydns"} {
|
|
e := Etcd{PathPrefix: path}
|
|
result := e.Path("service.staging.skydns.local.")
|
|
if result != "/"+path+"/local/skydns/staging/service" {
|
|
t.Errorf("Failure to get domain's path with prefix: %s", result)
|
|
}
|
|
}
|
|
}
|