I'm having an ongoing issue with my Android phone (Realme UI 5, Android 14) where it doesn't seem to consistently use my custom DNS setup through Pi-hole at home. I've attempted several solutions, such as setting a static DNS directly on my phone, enabling IPv6 DNS, and even disabling Private DNS. Despite these efforts, it behaves inconsistently. More often than not, my DNS queries completely bypass Pi-hole. Interestingly, right after I restart my phone, a small number of requests route through Pi-hole for only a brief moment (maybe around 10ms), and then it stops again. I ran some tests using Termux where `nslookup` shows that if I use the default DNS, my requests go through, but if I specify the Pi-hole DNS, it correctly blocks my queries. This leads me to believe that Android might be ignoring my DNS settings in favor of something else. Is there a chance there's a built-in DNS bypass, fallback DNS, or a hardcoded resolver in Realme UI or Android 14?
3 Answers
Are you using a VPN on your phone? Many VPN apps change the DNS settings to point to their own resolvers, which can mess with your custom DNS setup.
You might want to try running a DNS leak test. It can help you figure out what DNS server your device is actually using. Sometimes, there might be an unexpected configuration that's causing issues.
If you've set up your Pi-hole correctly on your home network, it shouldn't be an issue while connected to Wi-Fi. Could your phone be using mobile data during startup? That might explain the behavior you're seeing.

My Pi-hole works perfectly with my PC over DHCP, so I assumed my phone would do the same on Wi-Fi. I even checked the network settings on my phone through an app, and it shows that it’s using the Pi-hole DNS.