diff --git a/pkg/dns/dnscache.go b/pkg/dns/dnscache.go index 0eed00b4..ed204c11 100644 --- a/pkg/dns/dnscache.go +++ b/pkg/dns/dnscache.go @@ -197,7 +197,9 @@ func (c *DNSCache) restoreSets(fqdnSets []firewallv1.IPSet) { ipa, _, _ := strings.Cut(ip, ",") expirationTime := time.Now() if _, ets, found := strings.Cut(ip, ": "); found { - expirationTime.UnmarshalText([]byte(ets)) + if err := expirationTime.UnmarshalText([]byte(ets)); err != nil { + expirationTime = time.Now() + } } ipe.ips[ipa] = expirationTime }