diff --git a/internal/dnsforward/dns.go b/internal/dnsforward/dns.go index 770ac22538d..120c1d645a6 100644 --- a/internal/dnsforward/dns.go +++ b/internal/dnsforward/dns.go @@ -383,14 +383,13 @@ func (s *Server) ipToHost(ip net.IP) (host string, ok bool) { return "", false } - var typOK bool - if host, typOK = v.(string); !typOK { + if host, ok = v.(string); !ok { log.Error("dns: bad type %T in tableIPToHost for %s", v, ip) return "", false } - return host, ok + return host, true } // Respond to PTR requests if the target IP is leased by our DHCP server and the