Skip to content

Instantly share code, notes, and snippets.

@stjohnjohnson
Last active April 20, 2024 01:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stjohnjohnson/d441e26e4d77a975fd3ebb4e6f19e3d6 to your computer and use it in GitHub Desktop.
Save stjohnjohnson/d441e26e4d77a975fd3ebb4e6f19e3d6 to your computer and use it in GitHub Desktop.
version: '3'
services:
pihole:
image: pihole/pihole
hostname: pihole
restart: unless-stopped
ports:
- 53:53/tcp
- 53:53/udp
- 80:80/tcp
dns:
- 127.0.0.1
- 1.1.1.1
volumes:
- ./internal.conf:/etc/dnsmasq.d/02-internal.conf
- ./internal.list:/etc/pihole/internal.list
environment:
ServerIP: "10.0.0.205"
addn-hosts=/etc/pihole/internal.list
# This is a single domain to a server
10.0.0.210 plex.example.com
# Multiple domains can point to the same server
# (routed via different ports or a proxy like nginx)
10.0.0.205 haas.example.com
10.0.0.205 pihole.example.com
# Here is an example of short name
# (useful for things like short-url services)
10.0.0.215 go
# IPs do not need to be in your network
192.168.100.1 modem
all: build test clean
test:
@echo "========== Internal Domains =========="
dig @127.0.0.1 haas.example.com +short
dig @127.0.0.1 pihole.example.com +short
dig @127.0.0.1 plex.example.com +short
dig @127.0.0.1 go +short
dig @127.0.0.1 modem +short
@echo "========== External Domains =========="
dig @127.0.0.1 google.com +short
dig @127.0.0.1 github.com +short
build:
docker-compose up -d
until curl -f -I http://127.0.0.1; do sleep 1; done
clean:
docker-compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment