Toggle DoT and DoH profiles over command line

Hello everyone

I have a question regarding the newly introduced configuration profiles for DNS over HTTPS and TLS in Big Sur. After installing a profile, the DNS can be toggled active or inactive within the Network settings pane in the System Preferences (3 small dots at the bottom).

I would like to do the same via command line. I tried networksetup -setnetworkserviceenabled on/off, which does list VPNs but no DNS profiles. The DNS profiles don't show up under networksetup -listallnetworkservices.

They show up with profiles list, but there, profiles can only be removed, not disabled.

Could anyone please help me by letting me know the command in command line to toggle on/off the DNS just like in Network pane in System Preferences?

Thank you very much.

At this time the only way to activate this settings is through the UI. If command line support is something that would be useful please file feedback using Feedback Assistant.

Toggle DoT and DoH profiles over command line
 
 
Q