How Do I Use Pihole as a DNS Server?


Larry Thompson

Are you tired of annoying ads and tracking while browsing the internet? If so, Pi-hole might be the solution you’ve been looking for. In this tutorial, we will walk through how to use Pi-hole as a DNS server to block ads and improve your online privacy.

What is Pi-hole?

Pi-hole is an open-source network-wide ad blocker that acts as a DNS sinkhole. It functions by filtering out advertisements and tracking domains at the DNS level, preventing them from reaching your devices. By using Pi-hole as your DNS server, you can block ads across all devices connected to your network without the need for individual ad blockers on each device.

Setting up Pi-hole

To begin, you’ll need a Raspberry Pi or any other Linux-based device running a supported operating system. Follow these steps to set up Pi-hole:

  • Step 1: Install Raspbian or another supported Linux distribution on your Raspberry Pi.
  • Step 2: Update your system packages by running the command sudo apt update.
  • Step 3: Install Pi-hole by running the command curl -sSL | bash.
  • Step 4: Follow the on-screen prompts to configure your installation. You can choose options such as upstream DNS providers and blocklists during this step.

Configuring Devices to Use Pi-hole

To take advantage of Pi-hole’s ad-blocking capabilities, you need to configure your devices to use it as their DNS server:


If your router supports it, you can set Pi-hole as the default DNS server for your entire network. Access your router’s settings page and look for the DNS configuration options. Set the primary DNS server address to the IP address of your Pi-hole installation.

Individual Devices

If you prefer to configure devices individually, follow these steps:

  1. Step 1: Open the network settings on your device.
  2. Step 2: Find the DNS settings and change them to use a static IP address.
  3. Step 3: Set the primary DNS server address to the IP address of your Pi-hole installation.

Managing Pi-hole

Pi-hole provides a web-based interface to manage and monitor its functionality. To access it, open a web browser and enter “http:///admin” in the address bar. From here, you can view statistics, add custom blocklists, whitelist domains, and much more.


If you encounter any issues with Pi-hole or need further assistance, refer to their documentation or visit their community forums for support. The Pi-hole community is active and always willing to help.

In conclusion, using Pi-hole as a DNS server is an effective way to block ads and improve online privacy across all devices on your network. By following this tutorial, you should be able to set up and configure Pi-hole successfully.

Note: It’s important to keep your Pi-hole installation up-to-date by running regular updates using the command pihole -up.

Discord Server - Web Server - Private Server - DNS Server - Object-Oriented Programming - Scripting - Data Types - Data Structures

Privacy Policy