LogoLogo
DownloadBlog
  • Overview
  • Getting started
    • Meshnet explained
    • How to start using Meshnet
      • Using Meshnet on Windows
      • Using Meshnet on Android
      • Using Meshnet on iPhone/iPad
      • Using Meshnet on macOS
      • Using Meshnet on Linux
      • Using Meshnet on Android TV
    • How to use Meshnet securely
  • Features
    • Linking devices in Meshnet
      • Linking external Meshnet devices on Windows
      • Linking external Meshnet devices on Android
      • Linking external Meshnet devices on iPhone/iPad
      • Linking external Meshnet devices on macOS
      • Linking external Meshnet devices on Linux
      • Linking external Meshnet devices on Android TV
    • Explaining permissions
      • Remote access permissions
      • File sharing permissions
      • Traffic routing permissions
      • Local network permissions
    • Renaming devices in Meshnet
      • Renaming devices on Windows
      • Renaming devices on Android
      • Renaming devices on iPhone/iPad
      • Renaming devices on macOS
      • Renaming devices on Linux
    • Sharing files in Meshnet
      • Sharing files on Windows
      • Sharing files on Android
      • Sharing files on iPhone/iPad
      • Sharing files on macOS
      • Sharing files on Linux
      • Sharing files on Android TV
    • Routing traffic in Meshnet
      • Routing traffic from Windows
      • Routing traffic from Android
      • Routing traffic from iPhone/iPad
      • Routing traffic from macOS
      • Routing traffic from Linux
      • Routing traffic from Android TV
  • How-to guides
    • Gaming
      • How to set up a private Minecraft server with Meshnet
      • How to set up a private Stardew Valley server with Meshnet
      • How to play Quake 3 Arena over Meshnet
      • How to set up a private Team Fortress 2 server with Meshnet
      • How to set up a remote game-streaming server for Moonlight
      • How to set up a Palworld dedicated server
      • How to play Fallout: New Vegas multiplayer over Meshnet
      • How to set up a private Factorio server with Meshnet
    • Remote files and media access
      • How to set up and access shared folders
        • Configure and access shared folders on Windows
        • Configure and access shared folders on macOS
        • Configure and access shared folders on Linux
        • Access shared folders from Android
        • Access shared folders from iPhone/iPad
        • Access shared folders from Android TV
      • How to watch videos over Meshnet using Kodi
      • How to configure and access a Jellyfin media server remotely
      • How to set up a Plex media server and access it remotely
      • How to set up a remote NAS using OpenMediaVault and Meshnet
      • How to set up a remote picture library with LibrePhotos and Meshnet
      • How to use Syncthing for remote continuous file synchronization
      • How to set up a remote Airsonic music server
      • How to set up HTTP File Server for remote file access
      • How to set up a remote audiobook server
      • How to host a remote Kavita e-book server
      • How to set up and remotely access Immich using Meshnet
    • Remote device access
      • How to log in to your PC remotely over Meshnet
        • Connect to a Windows device
        • Connect to a macOS device
        • Connect to a Linux device
      • How to access remote systems over Meshnet using SSH
      • How to access your IP camera over Meshnet
      • How to use Home Assistant remotely over Meshnet
      • How to make secure macOS Time Machine backups from anywhere
      • How to use Ansible over Meshnet
      • How to access files in your NAS from anywhere without compromising its security
      • How to set up a phone as a security camera with remote access
      • How to assign custom host names to Meshnet services using Nginx proxy manager
      • How to use Proxmox VE remotely over Meshnet
      • How to set up a remotely controlled 3D printer
      • How to set up and remotely access a CasaOS server
    • Joint projects
      • How to set up an NGINX web server and remotely access it over Meshnet
      • How to use Nextcloud file syncing with Meshnet
      • How to set up pair programming using tmux
      • How to set up a Visual Studio Code server for remote development over Meshnet
      • How to host a Focalboard server for remote project management
      • How to use Meshnet for multi-screen Node.js development
      • How to use the Multi-user editing plugin in Unreal Engine over Meshnet
      • How to set up a private Mumble voice chat server
      • How to host a private Rocket.Chat server
    • Own VPN server setup
      • How to set up a VPN server through self-hosting or with DigitalOcean
      • How to create a VPN server with Microsoft Azure
      • How to create a VPN server with AWS
      • How to create a VPN server with Google Cloud
      • How to create a VPN server with Linode
      • How to create a VPN server with Hetzner
    • Network protection
      • How to set up your network protection with Pi-hole
      • How to set up your own DNS server
      • How to protect your network with AdGuard Home
      • How to use the self-hosted Whoogle search engine remotely
      • How to set up a VPN router using Meshnet
  • Troubleshooting
    • Common issues on Windows
    • Common issues on Android
    • Common issues on iPhone/iPad
    • Common issues on macOS
    • Common issues on Linux
Powered by GitBook

© 2025 Nord Security. All Rights Reserved.

On this page
  • Introduction
  • Before you begin
  • Install Pi-hole
  • Allow Meshnet connections in Pi-hole settings
  • Import blocklists to Pi-hole
  • Add URLs
  • Update gravity script
  • Use your Pi-hole DNS over Meshnet
  • Without a VPN connection
  • With a VPN connection

Was this helpful?

  1. How-to guides
  2. Network protection

How to set up your network protection with Pi-hole

Learn how to use Pi-hole for remote network protection over Meshnet.

PreviousNetwork protectionNextHow to set up your own DNS server

Last updated 1 month ago

Was this helpful?

Introduction

These days, the internet is full of advertisements and malicious websites. Due to this, many people resort to using third-party tools, such as or , to overcome the sheer amount of danger online. One such tool that enthusiasts tend to use more than others is Pi-hole.

allows you to transform your device to a local , which can be used as a network-wide ad blocker. While advertisement blocking is Pi-hole’s main purpose, you can use it for a variety of other options, such as local DNS mapping and website blacklisting.

On its own, Pi-hole only functions on the (LAN). However, with the power of , you can use Pi-hole on your devices remotely. Meshnet allows you to establish a secure and encrypted connection between your end device and the Pi-hole server.

While you can deploy a on Windows and macOS, this guide will walk you through the standard installation on Linux. It will also show how to configure your devices for remote use by setting the Pi-hole Meshnet IP address as your DNS address.

See the following overview video for additional information and instructions for the Pi-hole setup.

Alternatively, proceed with the detailed text-based instructions provided on this page.

Before you begin

Ensure that the machine you will use for Pi-hole meets the following criteria:

  • Linux distribution using Systemd or SysVinit

  • 2 GB of free disk space or more

  • 512 MB RAM or more

  • Static LAN IP address

Note

Install Pi-hole

  1. Open Terminal and run the following command to download and execute the Pi-hole installation script:

    curl -sSL https://install.pi-hole.net | bash
  2. Enter the sudo password of your Linux machine.

  3. In the installation dialog, select OK until you reach the Static IP needed window. If your device already has a static LAN IP address configured, select Continue. Otherwise, complete the necessary IP adjustments in your network.

  4. Choose the network interface that your device is using (for example, eth0, wlan0, enp0s3) and then choose Select.

  5. Select your preferred upstream DNS provider and select OK.

  6. Complete the installation process by choosing the blocklist, installing the Admin Web Interface with the required modules, and configuring the query logging settings.

  7. In the Installation complete window, note down the address and password for the Pi-hole web interface and select OK.

Tip

Make sure to change the password of your Pi-hole web interface to a unique and secure one. You can do so by executing the following command in the terminal:

pihole -a -p

Allow Meshnet connections in Pi-hole settings

Default Pi-hole settings allow requests only from the same local subnet of the host device (for example, 192.168.1.0/24). Since Meshnet IP addresses use a different subnet, Pi-hole will ignore all queries to the server.

To allow remote Meshnet connections to your Pi-hole, complete the following steps:

  1. Open your browser, enter the URL of the Pi-hole web interface that was provided in the Installation complete window, and log in.

    • If you are accessing the web interface from the host device directly, you can use this URL: http://localhost/admin

    • Otherwise, use the device’s local IP address instead of the localhost part.

  2. Go to Settings and select the DNS tab.

  3. Click Save.

Alternatively, you can run the following command in Terminal to enable listening on all network interfaces:

pihole -a -i all

Tip

If you want to change the upstream DNS addresses for your Pi-hole in the future, you can do so on the same DNS tab, under Upstream DNS servers.

Pi-hole is now installed and prepared for use via Meshnet.

Import blocklists to Pi-hole

With the additional features Pi-hole offers, you can further enhance your network security. One example is to import custom website blocklists to protect your devices from malicious and dangerous URLs or phishing domains.

Add URLs

To add blocklist URLs to Pi-hole:

  1. Open your Pi-hole web interface.

  2. Select Adlists.

  3. In the Address field, enter your preferred blocklist URL. Click Add.

You will see the newly added blocklist in the List of adlists section.

Update gravity script

  1. Open Pi-hole’s web interface and expand Tools.

  2. In the new window, press Update and wait for the process to finish.

  3. Once done, you will see a success message.

Alternatively, you can run the following command in Terminal:

pihole -g

Use your Pi-hole DNS over Meshnet

The Pi-hole configuration is now finished. However, to use Pi-hole and all of its features, you need to set up its Meshnet IP address as the DNS server on each of your client devices.

Without a VPN connection

Windows 11

  1. Choose the network type your device is using (Wi-Fi or Ethernet).

  2. Find the DNS server assignment option and click Edit.

  3. Choose Manual from the dropdown menu and enable IPv4.

  4. Fill in the DNS fields.

    • Preferred DNS server: the Meshnet IP of the Pi-hole device

    • Alternate DNS server: the DNS address of another provider

  5. Click Save.

Windows 10

  1. Select Change adapter options.

  2. Right-click your current network adapter (Wi-Fi or Ethernet) and choose Properties.

  3. In the new window, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.

  4. Select Use the following DNS server addresses and fill in the fields underneath.

    • Preferred DNS server: the Meshnet IP of the Pi-hole device

    • Alternate DNS server: the DNS address of another provider

  5. Click OK twice to apply the changes.

  1. Open the Settings menu.

  2. Go to Connections and select Wi-Fi.

  3. Find your current Wi-Fi network and tap the gear button.

  4. Go to Advanced/View more.

  5. Change the IP settings value to Static.

  6. Fill in the required DNS addresses.

    • Under DNS 1, enter the Meshnet IP of the Pi-hole device.

    • Under DNS 2, enter the DNS address of another provider.

  7. Tap Save (if such a button is present).

  1. Open Settings.

  2. Tap Configure DNS and choose Manual.

  3. Select Add server and enter the Meshnet IP of the Pi-hole device.

  4. Ensure that the added IP address is at the top.

  5. Tap Save.

macOS Ventura 13 and newer

  1. Go to System settings and click Network.

  2. Select the network interface you use (Wi-Fi or Ethernet) and click Details.

  3. Open the DNS tab and click the plus (+) button at the bottom to add the Meshnet IP address of the Pi-hole device.

  4. Ensure that the added IP address is at the top.

  5. Click OK to save the changes.

macOS Monterey 12 and older

  1. Go to System preferences and click Network.

  2. Select the network interface you use (Wi-Fi or Ethernet) and click Advanced.

  3. Open the DNS tab and add the Meshnet IP address of the Pi-hole device by clicking the plus (+) icon.

  4. Ensure that the added IP address is at the top.

  5. Click OK and then click Apply.

Method 1: Using Network Manager

  1. Open Settings, and then open either the Network or the Wi-Fi section (depending on your network type).

  2. Click the gear button and go to the IPv4 tab.

  3. Next to DNS, disable the Automatic toggle.

  4. Enter the Meshnet IP of the Pi-hole device and the DNS of another provider separated by a comma in the specified field.

  5. Click Apply.

  6. Open Terminal and run the following command to restart the Network Manager daemon:

    sudo systemctl restart NetworkManager

  7. Enter your sudo password.

Method 2: Using Terminal

  1. Open Terminal and run the following command:

    sudo nano /etc/systemd/resolved.conf

  2. Locate the DNS and FallbackDNS lines.

  3. Uncomment the lines by removing the hash (#) symbols.

  4. Enter the DNS addresses following the equals (=) sign. DNS=<Meshnet IP of the Pi-hole device> FallbackDNS=<DNS of another provider>

  5. Press Ctrl + X, Y, and Enter to exit and save the changes.

  6. Run the following command to ensure that the network changes are applied:

    sudo systemctl restart systemd-resolved

  7. Enter your sudo password.

Note

Changes in the /etc/systemd/resolved.conf file have a higher priority than settings in the Network Manager. Due to this, ensure that there are no custom configurations in the previously mentionedresolved.conf file if you apply the DNS change directly via the Network Manager settings. Otherwise, the specified DNS addresses will not be used.

  1. Open the Android TV Settings menu.

  2. Select Network & internet.

  3. Choose your network and change the IP settings value to Static.

  4. Enter your device's local IP address, network gateway, and network prefix length.

  5. Type in the DNS addresses:

    • In the DNS 1 field, enter the Meshnet IP address of your Pi-hole device.

    • In the DNS 2 field, enter the DNS address of another provider.

With a VPN connection

Meshnet allows you to use your custom, self-hosted DNS server alongside a VPN connection via the NordVPN app. Follow these steps to use your Pi-hole DNS when connected to a VPN server:

  1. Open the NordVPN app.

  2. Select the Connection section.

  3. Turn on the Use custom DNS toggle and click the dropdown arrow.

  4. In the first field, paste the copied Meshnet IP address.

  5. Click the Save checkmark.

Now, when you establish a VPN connection to a NordVPN server, the DNS addresses that you specified will be used for the connection.

Note

  1. Open the NordVPN app.

  2. Under VPN and security, tap DNS.

Now, when you establish a VPN connection to a NordVPN server, the DNS addresses that you specified will be used for the connection.

Note

  1. Open the NordVPN app.

  2. Under VPN connection, tap Protocol.

  3. In the Enter custom DNS address field, paste the copied Meshnet IP address.

Now, when you establish a VPN connection to a NordVPN server, the DNS addresses that you specified will be used for the connection.

Note

Note

  1. Open the NordVPN app.

  2. On the left, select the DNS section.

  3. Click Add new DNS.

  4. In the new entry, paste the copied Meshnet IP address.

  5. Turn on the Enable custom DNS servers toggle.

Now, when you establish a VPN connection to a NordVPN server, the DNS addresses that you specified will be used for the connection.

Note

  1. Open Terminal.

  2. Run the following command, replacing <MeshnetIP> with your Pi-hole device's Meshnet IP address:

    nordvpn set dns <MeshnetIP>

    Example

Now, when you establish a VPN connection to a NordVPN server, the DNS addresses that you specified will be used for the connection.

Note

To disable Threat Protection lite, use the nordvpn set tplite off command.

  1. Open the NordVPN app.

  2. Under App settings, select the DNS card and choose Custom.

  3. Select Add server.

  4. Enter the Meshnet IP address of your Pi-hole device.

Now, when you establish a VPN connection to a NordVPN server, the DNS address that you specified will be used for the connection.

Note

Tip

If you're looking for alternate DNS addresses, here are some of the most popular free DNS providers:

  • Google — 8.8.8.8 and 8.8.4.4

  • Cloudflare — 1.1.1.1 and 1.0.0.1

  • AdGuard — 94.140.14.14 and 94.140.15.15

  • Quad9 — 9.9.9.9 and 149.112.112.112

  • OpenDNS — 208.67.222.222 and 208.67.220.220

You can also use the same upstream DNS addresses from the Pi-hole configuration.

After changing the DNS server to the Pi-hole’s Meshnet IP address, the setup is finished. Now you can safely use Pi-hole’s protection features while being away from your home network.

machine and all client devices that will be using Pi-hole

For more detailed information, refer to the documentation.

Changing DNS addresses while using cellular data and keeping the Meshnet connection active is not possible. If you are using a mobile device with a cellular connection, you will need to use Pi-hole .

For alternative installation methods, refer to the page.

In the Interface section, select the Permit all origins option.

For this guide, blocklists from the website will be used.

To start using the newly imported blocklists, update Pi-hole’s .

Click Update gravity.

Right-click Start and select Network connections.

Right-click Start and select Network connections.

Tap Wi-Fi, find your current network and tap the Info button.

Navigate to the Devices in Meshnet tab and copy the Meshnet IP address of your Pi-hole device.

In the lower-left corner, click Settings .

In Threat protection pro > Advanced browsing protection, ensure that the DNS filtering toggle is turned off. Otherwise, the will overwrite the custom DNS change.

Navigate to Profile > Meshnet > Manage devices and copy the Meshnet IP address of your Pi-hole device.

Go back to the Profile menu, and then select Settings .

Select Custom, paste the copied Meshnet IP address, and tap Add.

On the Threat protection tab, ensure that the Use threat protection option is turned off. Otherwise, the will overwrite the custom DNS change.

Navigate to Profile > Meshnet > Manage devices and copy the Meshnet IP address of your Pi-hole device by tapping it.

Go back to the Profile menu and select Settings .

On the Threat protection tab, ensure that threat protection is turned off. Otherwise, the will overwrite the custom DNS change.

The custom DNS feature is available only on the version of the NordVPN app.

Navigate to the Meshnet tab and copy the Meshnet IP address of your Pi-hole device.

In the lower-left corner, click Settings .

In Threat protection pro > Overview, ensure that the DNS filtering toggle is turned off. Otherwise, the will overwrite the custom DNS change.

Make sure that Threat protection lite is turned off. Otherwise, the will overwrite the custom DNS change.

Navigate to the Settings tab.

On the Settings tab, under App settings, ensure that the Threat protection lite option is turned off. Otherwise, the will overwrite the custom DNS change.

Meshnet is enabled on the Linux
Pi-hole Prerequisites
Pi-hole installation
firebog.net
gravity script
direct download
Threat Protection feature
with a VPN connection
ad blockers
threat protection tools
Pi-hole
DNS server
local area network
Meshnet
Pi-hole Docker container
Threat Protection feature
Threat Protection feature
Threat Protection feature
Threat Protection feature
Threat Protection feature
Available network interfaces listed in Pi-hole installation window.
Pi-hole web UI address and password highlighted in the installation window.
Blocklist URL entered in Pi-hole settings.
Blocklist successfully added to Pi-hole.
Pi-hole and alternate DNS addresses entered.
Pi-hole DNS entered in macOS DNS settings.
Pi-hole DNS entered in macOS DNS settings.
Pi-hole Meshnet IP and alternate DNS address entered in Linux network settings.
Pi-hole Meshnet IP and alternate DNS address entered in the resolved.conf file.
Meshnet IP address entered in the DNS 1 field.
Entering the Meshnet IP address in the Use custom DNS section in the NordVPN app settings.
Entering the Meshnet IP address in the Use custom DNS section in the NordVPN app settings.
Entering the Meshnet IP address as the custom DNS server in the NordVPN app.
Clicking the Meshnet IP address of the peer device to copy it to the clipboard.
Enabling the custom DNS toggle in the NordVPN app settings.
Running the 'nordvpn set dns' command with the Meshnet IP address of the DNS server.
"Custom" option selected from the DNS menu.
Meshnet IP written in the 'Enter DNS server' field.