How do I change the phone DNS? (to make an Ad Blocker)

I want to do Ad Blocker

You will need to make an extension. I highly doubt the code would work. There is simply no way you can change such a system setting quite easily...

But to make (or rather implement) an adblocker, you could just put a CustomWebView in your app with AdBlock enabled!
Search the community to find out more...

Maybe someone who has more experience than me might be able to help you out...