How to set up DNS with Android script

Solved

Hi,

I'm looking for an Android script to setup Private DNS on Android with DNS over TLS type Hostname like "security.cloudflare-dns.com".

I managed to configure our VPN configuration with command like "writeprivateprofstring VPN Name0 IPSecXAuth3", but I can't for the DNS.

Do you have any suggestions please?

Cordially,

2 years ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
2 years ago

Are you talking about global DNS server setting for a device or domain related settings related to your  VPN configuration?

For the former,  I don't think there is any related MobiControl script command, not that I am aware of.

V
Valentin
2 years ago

Thank's for your reply.

I talking about global DNS server setting for a device, no for the VPN.

The setting in Android 12/13 is at : Settings -> Connection & sharing -> Private DNS -> OFF / Auto / Specified DNS.

I search a command script for manage this 3 settings.

RC
Raymond Chan Diamond Contributor
2 years ago

As said in my last post, there is no native MobiControl script to configure DNS related parameters that are configurable in Android 12/13  device 's Settings tab at Settings -> Connection & sharing -> Private DNS

If your device brand/model has a corresponding OEMConfig compliant app released by the device manufacturer, maybe you can check if such app provides such control for use with various MDM software including Soti MobiControl.

V
Valentin
2 years ago

Thank you for your answer, it's a pity that this script does not exist.

Unfortunately, I am not lucky enough to have an OEMconfig compatible fleet.

Cordially

T
Thomas
2 years ago

Hi Valentin

I just stumbled across this one - don't know what the opportunities are for adding a private host or if it's OEM-specific:

writesecuresetting -glo private_dns_mode off


Ref: https://supportcommunity.zebra.com/s/article/000022727?language=en_US

BR Thomas

V
Valentin
2 years ago

Hi Thomas,

Great ! Thank you very much for sharing, the command works fine to disable Private DNS !!

I did the following tests to set Auto or Custom but it does not work and the smartphone crashes in a loop.

Auto: writesecuresetting -glo private_dns_mode auto

DOH: writesecuresetting -glo private_dns_mode one.one.one.one

Does anyone have any suggestions for the correct spelling please?

Cordially,

J
Jeremy
9 months ago

I realize this is a very old post, but it's one of the few search results on this topic.

Here are the correct legacy script commands for Cloudflare's private DNS:

writesecuresetting -glo private_dns_mode hostname
writesecuresetting -glo private_dns_specifier one.one.one.one
Solution
V
Valentin
9 months ago

Thank you, it's the good command !

M
MPMOD@SOTI Gold Contributor
2 years ago

Hi Valentin,

Thank you for posting on Soti Pulse. Has Raymond's response clarified your questions? Please reach out to technical support if you need any more clarification.

Kind regards,

Technical Support Specialist | SOTI | +1 905.624.9828 | SOTI.net lDiscussion Forum | Log a Case Online l Facebook l LinkedIn l Twitter 

Similar Discussions