Skip to main content
  1. Posts/

Pihole Guide

·239 words·2 mins· loading · loading · ·
DNS Linux DNS Linux Pihole
Brock Henrie
Author
Brock Henrie
A little bit about me
Table of Contents
pihole - This article is part of a series.
Part 1: This Article

Repeat the process twice if you can. This will Allow network Traffic through the backup if the primary is overloaded or offline

Docker Pihole

No Docker
#

In an Ubuntu VM or Container

Become Root User. You Must Be Root User

sudo su 

Download and Install Pihole

curl -sSL https://install.pi-hole.net | bash

Just use the default settings

change password

pihole -a -p 

Docker
#

Make this Docker-compose file

version: "3"

# 

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
    environment:
      TZ: 'America/Phoenix'
      # WEBPASSWORD: 'set a secure password here or it will be random'
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      - NET_ADMIN
    restart: unless-stopped # Recommended but not required (DHCP needs NET_ADMIN)  

Change password

docker exec -it pihole bash

pihole - a -p

Launch
#

sudo docker-compose up -d

UI
#

Visit

http://<IP_ADDRESS_OF_YOUR_PI_HOLE>/admin/

Pihole K8S Ingress
#

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: pihole-prefix
  namespace: default

spec:
  stripPrefix:
    prefixes:
      - /admin

If 53 taken on ubuntu
#

Ubuntu 19.10, clean install not messed around. I use Docker and would like to install PiHole via Docker Compose.

However on Ubuntu systemd-resolve uses port 53 by default. That port needs to be available for port binding for PiHole. To solve this: sudo nano /etc/systemd/resolved.conf

Uncomment and change to no (everything is commented out by default):

DNSStubListener=no Restart the service.

pihole - This article is part of a series.
Part 1: This Article

Related

Terraform Pihole Records
·713 words·4 mins· loading · loading
Terraform DNS Pihole Gitops Pihole DNS Terraform Gitops