Temporarily Logs (2 days):
- Google logs the IP address of every device sending a DNS query.
- For DNS-over-HTTPS, logs Content-Type & Accept HTTP headers
Permanently Logs:
- Client's autonomous system number
- User's geolocation within 1 km^2 and 1000 people.
- Timestamp
- Requested Domain Name
- Request Domain type
- Transport Protocol
- EDNS version, option
- and a few more, essentially everything but your IP address.
This is enough permanent information to successfully identify the vast majority of people even if they never permanently log your IP - and that's just by itself, not including if you use other google services. Other services such as Cloudflare DNS or OpenDNS provide a higher degree of privacy and can even be faster than Google's DNS.
Google's DNS policy: https://developers.google.com/speed/public-dns/privacy
Cloudflare's DNS policy: https://developers.cloudflare.com/1.1.1.1/privacy/public-dns...
OpenDNS's policy: https://umbrella.cisco.com/blog/privacy-policy-update