aboutsummaryrefslogtreecommitdiff
path: root/plugin/backend_lookup.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/backend_lookup.go')
-rw-r--r--plugin/backend_lookup.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugin/backend_lookup.go b/plugin/backend_lookup.go
index 77e08174f..090f36215 100644
--- a/plugin/backend_lookup.go
+++ b/plugin/backend_lookup.go
@@ -391,7 +391,13 @@ func NS(b ServiceBackend, zone string, state request.Request, opt Options) (reco
// SOA returns a SOA record from the backend.
func SOA(b ServiceBackend, zone string, state request.Request, opt Options) ([]dns.RR, error) {
- header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: 300, Class: dns.ClassINET}
+ minTTL := b.MinTTL(state)
+ ttl := uint32(300)
+ if minTTL < ttl {
+ ttl = minTTL
+ }
+
+ header := dns.RR_Header{Name: zone, Rrtype: dns.TypeSOA, Ttl: ttl, Class: dns.ClassINET}
Mbox := hostmaster + "."
Ns := "ns.dns."
@@ -407,7 +413,7 @@ func SOA(b ServiceBackend, zone string, state request.Request, opt Options) ([]d
Refresh: 7200,
Retry: 1800,
Expire: 86400,
- Minttl: b.MinTTL(state),
+ Minttl: minTTL,
}
return []dns.RR{soa}, nil
}