Round TTLs

This commit is contained in:
Frank Denis 2021-09-23 19:10:40 +02:00
parent 34f0caaa34
commit a4684d3bf5
1 changed files with 3 additions and 0 deletions

View File

@ -196,6 +196,9 @@ func updateTTL(msg *dns.Msg, expiration time.Time) {
ttl := uint32(0)
if until > 0 {
ttl = uint32(until / time.Second)
if until-time.Duration(ttl)*time.Second < until/2 {
ttl += 1
}
}
for _, rr := range msg.Answer {
rr.Header().Ttl = ttl