You can use Pi Hole both on your local network and on cloud as VPN on your iPhone (only DNS or for full traffic)
There might be commercial products that do this for you. Setting this up is definitely outside of the comfort zone for the overwhelming majority of phone users.
https://discourse-cdn.pi-hole.net/uploads/default/original/2...
https://discourse.pi-hole.net/uploads/default/original/2X/5/...