You should know the risks when you use your phone to browse the internet on a public network. Turning on Private DNS ensures your queries are encrypted and protected from malicious actors. This guide shows you how to change your phone’s DNS to Google or Cloudflare (or other) for a faster and more secure browsing experience.
Besides the speed and performance, these DNS services offer additional security, like DNS-over-HTTPS and DNSSEC. And they don’t keep a log of user activity, which could pose a security risk. And since your browsing activity is encrypted, your ISP or a hacker cannot determine the websites you visit.
Although the linked article mentions Google and Cloudflare, there is also an option to set a private DNS hostname as well, such as Quad9. You just need to type the actual DNS address in to use it.
The iPhone can do the same thing (but Wi-Fi only as far as I recall), so it is worth exploring these settings under Wi-Fi settings.
See https://www.androidpolice.com/how-to-change-your-phones-dns-to-google-or-cloudflare/