Search code examples
iosmdm

iOS configuration profiles to change DNS settings


Is it possible to change only the DNS settings on iOS devices with configuration profiles?

If not, I'm guessing MDM is a possible workaround. How could this be implemented?


Solution

  • In MDM profile check this out: IPSec > OnDemandRules >

    <key>OnDemandRules</key> <array> <dict> <key>Action</key> <string>EvaluateConnection</string> <key>ActionParameters</key> <array> <dict> <key>DomainAction</key> <string>ConnectIfNeeded</string> <key>Domains</key> <array> <string>example1.com</string> <string>example2.com</string> <string>example3.com</string> </array> <key>RequiredDNSServers</key> <array> <string>mydns.com</string> </array> </dict> </array> </dict> </array>

    The limitation is that the DNS request will only perform for the listed domains. Better than nothing.

    UPD: I just found that using:

            <key>Domains</key>
                <array>
                    <string>.</string>
                </array>
    

    will wildcard the filter. So you'll get all DNS requests from the device, doesn't matter what domain it is.