diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a9d544e95..a0cf3821cb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ NOTE: Add new changes BELOW THIS COMMENT. - The ability to apply an invalid configuration for private RDNS, which led to server inoperability. +- Ignoring query log for clients with ClientID set ([#5812]). - Subdomains of `in-addr.arpa` and `ip6.arpa` containing zero-length prefix incorrectly considered invalid when specified for private RDNS upstream servers ([#6854]). @@ -38,6 +39,7 @@ NOTE: Add new changes BELOW THIS COMMENT. ([#6875]). [#5345]: https://github.com/AdguardTeam/AdGuardHome/issues/5345 +[#5812]: https://github.com/AdguardTeam/AdGuardHome/issues/5812 [#6854]: https://github.com/AdguardTeam/AdGuardHome/issues/6854 [#6875]: https://github.com/AdguardTeam/AdGuardHome/issues/6875 diff --git a/internal/dnsforward/stats.go b/internal/dnsforward/stats.go index 220f151c0cb..4344380d045 100644 --- a/internal/dnsforward/stats.go +++ b/internal/dnsforward/stats.go @@ -29,7 +29,13 @@ func (s *Server) processQueryLogsAndStats(dctx *dnsContext) (rc resultCode) { log.Debug("dnsforward: client ip for stats and querylog: %s", ipStr) - ids := []string{ipStr, dctx.clientID} + ids := []string{ipStr} + if dctx.clientID != "" { + // Use the ClientID first because it has a higher priority. Filters + // have the same priority, see applyAdditionalFiltering. + ids = []string{dctx.clientID, ipStr} + } + qt, cl := q.Qtype, q.Qclass // Synchronize access to s.queryLog and s.stats so they won't be suddenly