Pi-Hole + GCP: How to create your own DNS Adblock Server
In this article I’ll show you how to create your own DNS Adblock server using Pi-Hole. So what is
Pi-hole is a DNS sinkhole that protects your devices from unwanted content, without installing any client-side software.
- The article assumed you already have a Google Cloud Platform account and you already know how to use Compute Engine service.
Create Firewall Rule
You need create a new Firewall Rule. To create new Firewall Rule click the Menu on top left, click VPC Network and click Firewall Rules. Click Create Firewall Rule. This is configuration of the firewall rule:
- Target: All instances in the network
- Source IP ranges:
- Protocols and ports:
Create Virtual Machine (VM) instance
Create your own VM server with this configuration (recommend)
- vCPU: 1
- Memory: 1 Gb
- Disk size: 20 Gb
- Disk image: Debian GNU/ Linux 9
Select Allow HTTP traffic in the Firewall section
Expand Management, Security, disks, networking, sole tenancy. In External IP section choose Create IP Address to Reserve a new static IP address.
Now you can ssh to server by click to SSH button or add your own SSH key to your server.
Follow the commands below to install
$ sudo apt update && sudo apt upgrade -y$ curl -sSL https://install.pi-hole.net | bash
At DNS Provider section. You can choose provider you want. In this article I choose Quad9 (filtered + ECS).
In Protocols section deselect IPv6
Choose OK for all the other prompts.
Change password for login the Web Interface with this command:
$ pihole -a -p
Login into the web interface using the External IP:
Click Settings, in DNS tab. Set your Interface Listening Behavior to Listen on All Interfaces
Now replace your DNS in your computer or mobile.