NextDNS Integration: Temporarily Disable Blocking

Allow the new NextDNS Integration to change the NextDNS configuration ID. This would resolve a long-standing NextDNS user request - the ability to temporarily disable blocking.

To accomplish this currently:

  • I have two NextDNS configurations, one for standard blocking and one for no blocking (i.e. no blocklists are specified, but other protection remains in place).
  • I have a Raspberry Pi running the NextDNS CLI and use an MQTT message from Home Assistant to execute a CLI command to change the configuration; specifically, “sudo nextdns install -config XXXXXX”.
  • Using a helper switch, anyone in the household can say “Alexa, turn off blocking” and a script or Node Red flow sends the no blocking configuration ID to the Pi and, 30 seconds later, sends the blocking configuration ID to reenable it

Family members are much more accepting of blocking now that they have the ability to temporarily turn it off.

The configuration IDs are 6 characters and are associated with the account (thus should be able to use the same API key).

Note: There are activate/deactivate options in the NextDNS CLI but I could not get them to work. If reliable, that would be useful also.

I would be happy to help test if this is developed.


I’m currently using AdGuard Home and I similarly expose a helper to allow it to be disabled temporarily. Discovering I can’t do that with NextDNS has put a halt on my plan to fully migrate over.

I gather than you can deactivate via the NextDNS CLI but I’ve not got that working yet. If it does work, then I can have NR SSH into the router. Its not exactly elegant but if it works then that would be fine. Not something the integration could handle of course…

If I understand correctly you want to change the NextDNS profile that the device is using. This is not possible via NextDNS API. You can enable or disable blocking features using the switches, you can create an automation to temporary disable some NextDNS features.

I could not get activate/deactivate to work either, but NextDNS allows one account to have multiple “configurations”. Each configuration has a unique 6 character id you can view on the NextDNS web site Setup tab. I created a second configuration with no blocklists. I switch between the blocked configuration id and the unblocked by executing this command on the Pi “sudo nextdns install -config XXXXXX” where XXXXXX is the 6 character id I want to use. It’s all under the same account. Even though it invokes install, it executes immediately with no user input required.

I also switched from Adblock Home and almost gave up until I discovered this capability. I can use NextDNS on my iPhone and iPad when traveling and connected to the cell network, a big benefit.

Can you change the “configuration id” with the API? See my response to Nuuki. If possible, it opens up quite a few possibilities.

I’ll experiment with the switches to see if I can get similar behavior.

This is a big difference between HA integration using official NextDNS API and running the nextdns binary with root privileges.


Thanks Maciek.

I realized the flaw in my original request. If Home Assistant is not the NextDNS network device, it cannot possibly change the configuration that NextDNS is using. For anyone else looking to disable NextDNS running on a separate Raspberry Pi, the method I described earlier does work. I hope this is helpful to others.

Is it possible (or planned?) to be able to add or remove a single domain to the list of permitted domains or the list of not-permitted domains?