aboutsummaryrefslogtreecommitdiff
path: root/plugin/backend_lookup.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-11-01 10:11:34 +0000
committerGravatar GitHub <noreply@github.com> 2017-11-01 10:11:34 +0000
commit2c80551fdc1ac409eb11dc8dd9e7fe90fb04d90c (patch)
tree4583a46a237c794296623f86724bde56d3d79f4e /plugin/backend_lookup.go
parentfa2ae3fb4321052326a906da91df8ce8e80ae5a4 (diff)
downloadcoredns-2c80551fdc1ac409eb11dc8dd9e7fe90fb04d90c.tar.gz
coredns-2c80551fdc1ac409eb11dc8dd9e7fe90fb04d90c.tar.zst
coredns-2c80551fdc1ac409eb11dc8dd9e7fe90fb04d90c.zip
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)
Diffstat (limited to 'plugin/backend_lookup.go')
-rw-r--r--plugin/backend_lookup.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/plugin/backend_lookup.go b/plugin/backend_lookup.go
index f04b397b2..9112b73aa 100644
--- a/plugin/backend_lookup.go
+++ b/plugin/backend_lookup.go
@@ -4,7 +4,6 @@ import (
"fmt"
"math"
"net"
- "time"
"github.com/coredns/coredns/plugin/etcd/msg"
"github.com/coredns/coredns/plugin/pkg/dnsutil"
@@ -371,11 +370,11 @@ func SOA(b ServiceBackend, zone string, state request.Request, opt Options) ([]d
soa := &dns.SOA{Hdr: header,
Mbox: Mbox,
Ns: Ns,
- Serial: uint32(time.Now().Unix()),
+ Serial: b.Serial(state),
Refresh: 7200,
Retry: 1800,
Expire: 86400,
- Minttl: minTTL,
+ Minttl: b.MinTTL(state),
}
return []dns.RR{soa}, nil
}
@@ -404,7 +403,4 @@ func newAddress(s msg.Service, name string, ip net.IP, what uint16) dns.RR {
return &dns.AAAA{Hdr: hdr, AAAA: ip}
}
-const (
- minTTL = 60
- hostmaster = "hostmaster"
-)
+const hostmaster = "hostmaster"