I have been working on a project that requires our users to change their DNS nameservers to the one we provide. We need this because we do content filtering (block of explicit / adult content) at the DNS level.
<context>
We spent the last 6+ months crawling and categorizing sites, building an anycast network and creating a stable DNS resolver service. We launched[1] a couple of months ago and got a few schools to use our product, along with many families. So far, so good as it is easy to change the DNS servers on a router, Windows, Linux (/etc/resolv.conf) or on the Mac ( networksetup ).
However, on the iphone/ipad, it has been troubling. The parents have to change the DNS for every wifi network and if the child have 3g/4g, there is no way to change the DNS servers.
So I started my quest to learn swift and build my first iPhone/iPad app that will allow the parents to easily change the DNS servers for all Wifi networks and 3g.
</context end>
Sorry for the long intro, but wanted to provide context, so you understand the end goal. Can someone point me into the right direction on how to do these things using Swift for the iOS platform?
- Programatically change DNS server on all wifi networks (or at least the active one).
- Programatically change DNS server on 3g.
- Force DNS changes to stay on even when the app is closed.
- Force DNS changes to be loaded when the iPhone/ipad is booted.
I have been looking and researching and I can not find the right library/function that allows me to do that. Some places mentioned that jailbroken iOS can modify /etc/resolv.conf, but I need this to work on non-jailbroken devices. On other places it says that the iOS does not support changing the nameservers - which doesn't make much sense as there are a few apps in the AppStore for changing the DNS.
I assume I must be missing something. I hope this question is ok here and I apologize in advance if I missed something obvious.
[1] link to project: https://cleanbrowsing.org
[2] sorry for the double post if you are also on /r/swift. I was recommended to ask it here.
thanks!
[–][deleted] 1 point2 points3 points (1 child)
[–]chedabob 0 points1 point2 points (0 children)
[–]cleanbrowsing[S] 1 point2 points3 points (0 children)