Skip to content

Conditional Profile

Olivier Poitrey edited this page Jan 25, 2023 · 1 revision

When installed on a router, nextdns can apply different profile based on the LAN client using conditional configuration parameters. The -profile parameter can be specified several times with different profile IDs and conditions. Conditions can be subnet prefixes or MAC addresses.

If for instance, we want:

  • Clients in the 10.0.4.0/24 subnet to have the 12345 profile
  • The host with the 00:1c:42:2e:60:4a MAC address to have the 67890 profile
  • The rest of the network to have the abcdef profile

The install command would be as follow:

sudo nextdns config set \
    -profile 10.0.4.0/24=12345 \
    -profile 00:1c:42:2e:60:4a=67890 \
    -profile abcdef
sudo nextdns restart

Note: the -setup-router will auto-detect the type of router and apply the appropriate changes to integrate with it.