NextDNS

The NextDNS integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] is used to integrate with NextDNS, a DNS service that protects you from security threats, blocks advertisements and trackers on websites and in apps, and provides a safe and supervised internet for kids on all devices and on all networks. The integration lets you monitor NextDNS statistics and control its configuration.

You can use it to:

  • Monitor DNS queries from your local network or individual devices.
  • Track DNS query protocols to understand connection security.
  • Manage children’s screen time by scheduling access to social media, games, and streaming services.

Prerequisites

  1. Sign in to your NextDNS account.
  2. Copy the API key shown on the account page.

Configuration

To add the NextDNS service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

API Key

The API key for your NextDNS account.

Profile

The NextDNS configuration profile you want to integrate.

Supported functionality

The NextDNS integration provides the following entities.

Binary sensors

  • Device connection status
    • Description: Indicates whether the Home Assistant server is using NextDNS for DNS queries
  • Device profile connection status
    • Description: Indicates whether the Home Assistant server uses the configured NextDNS profile for DNS queries

Buttons

  • Clear logs
    • Description: Triggers clearing DNS query logs on NextDNS servers

Sensors

  • DNS queries
    • Description: Shows the total number of DNS queries
  • DNS queries blocked
    • Description: Shows the number of blocked DNS queries
  • DNS queries blocked ratio
    • Description: Shows the percentage of blocked DNS queries
  • DNS-over-HTTP/3 queries
    • Description: Shows the number of DNS queries via DNS-over-HTTP/3
    • Remarks: This entity is disabled by default
  • DNS-over-HTTP/3 queries ratio
    • Description: Shows the percentage of DNS queries via DNS-over-HTTP/3
    • Remarks: This entity is disabled by default
  • DNS-over-HTTPS queries
    • Description: Shows the number of DNS queries via DNS-over-HTTPS
    • Remarks: This entity is disabled by default
  • DNS-over-HTTPS queries ratio
    • Description: Shows the percentage of DNS queries via DNS-over-HTTPS
    • Remarks: This entity is disabled by default
  • DNS-over-QUIC queries
    • Description: Shows the number of DNS queries via DNS-over-QUIC
    • Remarks: This entity is disabled by default
  • DNS-over-QUIC queries ratio
    • Description: Shows the percentage of DNS queries via DNS-over-QUIC
  • DNS-over-TLS queries
    • Description: Shows the number of DNS queries via DNS-over-TLS
    • Remarks: This entity is disabled by default
  • DNS-over-TLS queries ratio
    • Description: Shows the percentage of DNS queries via DNS-over-TLS
    • Remarks: This entity is disabled by default
  • TCP queries
    • Description: Shows the number of DNS queries via TCP
    • Remarks: This entity is disabled by default
  • TCP queries ratio
    • Description: Shows the percentage of DNS queries via TCP
    • Remarks: This entity is disabled by default
  • UDP queries
    • Description: Shows the number of DNS queries via UDP
    • Remarks: This entity is disabled by default
  • UDP queries ratio
    • Description: Shows the percentage of DNS queries via UDP
    • Remarks: This entity is disabled by default
  • Encrypted queries
    • Description: Shows the number of encrypted DNS queries
    • Remarks: This entity is disabled by default
  • Encrypted queries ratio
    • Description: Shows the percentage of encrypted DNS queries
    • Remarks: This entity is disabled by default
  • Unencrypted queries
    • Description: Shows the number of unencrypted DNS queries
    • Remarks: This entity is disabled by default
  • IPv4 queries
    • Description: Shows the number of DNS queries via IPv4
    • Remarks: This entity is disabled by default
  • IPv6 queries
    • Description: Shows the number of DNS queries via IPv6
    • Remarks: This entity is disabled by default
  • IPv6 queries ratio
    • Description: Shows the percentage of DNS queries via IPv6
    • Remarks: This entity is disabled by default
  • DNSSEC validated queries
    • Description: Shows the number of DNS queries validated by DNSSEC
    • Remarks: This entity is disabled by default
  • DNSSEC validated queries ratio
    • Description: Shows the percentage of DNS queries validated by DNSSEC
    • Remarks: This entity is disabled by default
  • DNSSEC not validated queries
    • Description: Shows the number of DNS queries not validated by DNSSEC
    • Remarks: This entity is disabled by default
  • DNS queries relayed
    • Description: Shows the number of relayed DNS queries

Switches

  • AI-Driven threat detection
    • Description: Controls AI-driven threat detection
  • Allow affiliate & tracking links
    • Description: Controls affiliate and tracking links
  • Anonymized EDNS client subnet
    • Description: Controls anonymized EDNS client subnet
  • Bypass age verification
    • Description: Controls bypass of age verification pages
  • CNAME flattening
    • Description: Controls CNAME flattening
  • Cryptojacking protection
    • Description: Controls cryptojacking protection
  • Domain generation algorithms protection
    • Description: Controls protection against domain generation algorithms
  • DNS rebinding protection
    • Description: Controls DNS rebinding protection
  • Google safe browsing
    • Description: Controls Google Safe Browsing protection
  • IDN homograph attacks protection
    • Description: Controls protection against IDN homograph attacks
  • Logs
    • Description: Controls log collection
  • Force SafeSearch
    • Description: Controls SafeSearch enforcement
  • Typosquatting protection
    • Description: Controls protection against typosquatting domains
  • Web3
    • Description: Controls access to Web3 and crypto domains
  • Force YouTube restricted mode
    • Description: Controls YouTube Restricted Mode enforcement
  • Block newly registered domains
    • Description: Controls blocking of newly registered domains
  • Block bypass methods
    • Description: Controls blocking of filter bypass methods
  • Block child sexual abuse material
    • Description: Controls blocking of child sexual abuse material
  • Block data-drop services
    • Description: Controls blocking of data-drop services
  • Block decentralized web gateways
    • Description: Controls blocking of decentralized web gateways
  • Block dynamic DNS hostnames
    • Description: Controls blocking of dynamic DNS hostnames
  • Block disguised third-party trackers
    • Description: Controls blocking of disguised third-party trackers
  • Block free hosting domains
    • Description: Controls blocking of free hosting domains
  • Block page
    • Description: Controls the display of the blocking page
  • Block online gaming
    • Description: Controls blocking of online gaming
  • Block parked domains
    • Description: Controls blocking of parked domains
  • Block piracy
    • Description: Controls blocking of piracy websites
    • Remarks: This entity is disabled by default
  • Block porn
    • Description: Controls blocking of pornographic content
    • Remarks: This entity is disabled by default
  • Block residential hosting
    • Description: Controls blocking of residential hosting
  • Block social networks
    • Description: Controls blocking of social networks
    • Remarks: This entity is disabled by default
  • Block tunneling endpoints
    • Description: Controls blocking of tunneling endpoints
  • Block video streaming
    • Description: Controls blocking of video streaming websites
    • Remarks: This entity is disabled by default
  • Block dating
    • Description: Controls blocking of dating websites
    • Remarks: This entity is disabled by default
  • Block gambling
    • Description: Controls blocking of gambling websites
    • Remarks: This entity is disabled by default
  • Block 9GAG
    • Description: Controls 9GAG access
    • Remarks: This entity is disabled by default
  • Block Amazon
    • Description: Controls Amazon access
    • Remarks: This entity is disabled by default
  • Block BeReal
    • Description: Controls BeReal access
    • Remarks: This entity is disabled by default
  • Block Blizzard
    • Description: Controls Blizzard access
    • Remarks: This entity is disabled by default
  • Block ChatGPT
    • Description: Controls ChatGPT access
    • Remarks: This entity is disabled by default
  • Block Dailymotion
    • Description: Controls Dailymotion access
    • Remarks: This entity is disabled by default
  • Block Discord
    • Description: Controls Discord access
    • Remarks: This entity is disabled by default
  • Block Disney Plus
    • Description: Controls Disney Plus access
    • Remarks: This entity is disabled by default
  • Block eBay
    • Description: Controls eBay access
    • Remarks: This entity is disabled by default
  • Block Facebook
    • Description: Controls Facebook access
    • Remarks: This entity is disabled by default
  • Block Fortnite
    • Description: Controls Fortnite access
    • Remarks: This entity is disabled by default
  • Block Google Chat
    • Description: Controls Google Chat access
    • Remarks: This entity is disabled by default
  • Block HBO Max
    • Description: Controls HBO Max access
    • Remarks: This entity is disabled by default
  • Block Hulu
    • Description: Controls Hulu access
    • Remarks: This entity is disabled by default
  • Block Imgur
    • Description: Controls Imgur access
    • Remarks: This entity is disabled by default
  • Block Instagram
    • Description: Controls Instagram access
    • Remarks: This entity is disabled by default
  • Block League of Legends
    • Description: Controls League of Legends access
    • Remarks: This entity is disabled by default
  • Block Mastodon
    • Description: Controls Mastodon access
    • Remarks: This entity is disabled by default
  • Block Messenger
    • Description: Controls Facebook Messenger access
    • Remarks: This entity is disabled by default
  • Block Minecraft
    • Description: Controls Minecraft access
    • Remarks: This entity is disabled by default
  • Block Netflix
    • Description: Controls Netflix access
    • Remarks: This entity is disabled by default
  • Block Pinterest
    • Description: Controls Pinterest access
    • Remarks: This entity is disabled by default
  • Block PlayStation Network
    • Description: Controls PlayStation Network access
    • Remarks: This entity is disabled by default
  • Block Prime Video
    • Description: Controls Prime Video access
    • Remarks: This entity is disabled by default
  • Block Reddit
    • Description: Controls Reddit access
    • Remarks: This entity is disabled by default
  • Block Roblox
    • Description: Controls Roblox access
    • Remarks: This entity is disabled by default
  • Block Signal
    • Description: Controls Signal access
    • Remarks: This entity is disabled by default
  • Block Skype
    • Description: Controls Skype access
    • Remarks: This entity is disabled by default
  • Block Snapchat
    • Description: Controls Snapchat access
    • Remarks: This entity is disabled by default
  • Block Spotify
    • Description: Controls Spotify access
    • Remarks: This entity is disabled by default
  • Block Steam
    • Description: Controls Steam access
    • Remarks: This entity is disabled by default
  • Block Telegram
    • Description: Controls Telegram access
    • Remarks: This entity is disabled by default
  • Block TikTok
    • Description: Controls TikTok access
    • Remarks: This entity is disabled by default
  • Block Tinder
    • Description: Controls Tinder access
    • Remarks: This entity is disabled by default
  • Block Tumblr
    • Description: Controls Tumblr access
    • Remarks: This entity is disabled by default
  • Block Twitch
    • Description: Controls Twitch access
    • Remarks: This entity is disabled by default
  • Block X (formerly Twitter)
    • Description: Controls X (formerly Twitter) access
    • Remarks: This entity is disabled by default
  • Block Vimeo
    • Description: Controls Vimeo access
    • Remarks: This entity is disabled by default
  • Block VK
    • Description: Controls VK access
    • Remarks: This entity is disabled by default
  • Block WhatsApp
    • Description: Controls WhatsApp access
    • Remarks: This entity is disabled by default
  • Block Xbox Network
    • Description: Controls Xbox Network access
    • Remarks: This entity is disabled by default
  • Block YouTube
    • Description: Controls YouTube access
    • Remarks: This entity is disabled by default
  • Block Zoom
    • Description: Controls Zoom access
    • Remarks: This entity is disabled by default

NextDNS automation examples

Here are a few ideas to get you started.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: Block social media for kids in the evening

This automation turns on the Block social networks switch of the kids profile every evening.

  • Trigger: Time: 20:00
  • Action: Turn on switch
    • Target: Block social networks (switch.kids_block_social_networks)
YAML example for blocking social media in the evening
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Block social media for kids in the evening"
triggers:
  - trigger: time
    at: "20:00:00"
actions:
  - action: switch.turn_on
    target:
      entity_id: switch.kids_block_social_networks

Automation: Unblock social media for kids after school

This automation turns off the Block social networks switch of the kids profile after school.

  • Trigger: Time: 16:00
  • Action: Turn off switch
    • Target: Block social networks (switch.kids_block_social_networks)
YAML example for unblocking social media after school
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Unblock social media for kids after school"
triggers:
  - trigger: time
    at: "16:00:00"
actions:
  - action: switch.turn_off
    target:
      entity_id: switch.kids_block_social_networks

Data updates

The NextDNS integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] data from the NextDNS API by default:

  • Every 5 minutes for connection status
  • Every 10 minutes for analytics
  • Every minute for settings

Known limitations

There are no known limitations.

Removing the integration

This integration follows standard integration removal.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. Next to the entry you want to remove, select the three dots menu. Then, select Delete.
    • Depending on the integration, the entries are listed under one of the following headings:
      • Devices
      • Hubs
      • Services
      • Integration entries
  3. To confirm, select Delete.
    • Home Assistant also deletes the devices and entities of the entry.
  4. If Home Assistant asks you to restart, restart Home Assistant.
  5. If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.