Port 80 is used on my ubuntu already so I figured I go this guide Free your Synology ports for Docker | Tony Lawrence to setup pi-hole. Here is my complete yaml file (except mask of domainname):
version: '2'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
hostname: pihole
domainname: xxx.duckdns.org # <-- Update
mac_address: 36:c8:98:79:b5:55
cap_add:
- NET_ADMIN
networks:
pihole_network:
ipv4_address: 192.168.2.5 # <-- Update
# volumes:
#- './etc-pihole/:/etc/pihole/'
#- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
dns:
- 127.0.0.1
- 8.8.8.8
ports:
- 443/tcp
- 53/tcp
- 53/udp
- 67/udp
- 80/tcp
environment:
ServerIP: 192.168.2.5 # <-- Update (match ipv4_address)
VIRTUAL_HOST: pihole.xxx.duckdns.org # <-- Update (match hostname + domainname)
WEBPASSWORD: "" # <-- Add password (if required)
restart: unless-stopped
networks:
pihole_network:
driver: macvlan
driver_opts:
parent: enp9s0 # run this on ubuntu18 to find: sudo lshw -C network
ipam:
config:
- subnet: 192.168.2.0/24 # <-- Update
gateway: 192.168.2.1 # <-- Update
ip_range: 192.168.2.4/30 # <-- Update
here is the log file that once started the docker:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-resolver-resolv: applying...
[fix-attrs.d] 01-resolver-resolv: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 20-start.sh: executing...
::: Starting docker specific checks & setup for docker pihole/pihole
WARNING Misconfigured DNS in /etc/resolv.conf: Two DNS servers are recommended, 127.0.0.1 and any backup server
WARNING Misconfigured DNS in /etc/resolv.conf: Primary DNS should be 127.0.0.1 (found 127.0.0.11)
nameserver 127.0.0.11
options ndots:0
[i] Existing PHP installation detected : PHP version 7.0.33-0+deb9u5
[i] Installing configs from /etc/.pihole...
[i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
[✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf
chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
[✓] Password Removed
Using default DNS servers: 8.8.8.8 & 8.8.4.4
DNSMasq binding to default interface: eth0
Added ENV to php:
"PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",
"ServerIP" => "192.168.2.5",
"VIRTUAL_HOST" => "pihole.xxx.duckdns.org",
Using IPv4 and IPv6
::: Preexisting ad list /etc/pihole/adlists.list detected ((exiting setup_blocklists early))
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
http://sysctl.org/cameleon/hosts
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
https://hosts-file.net/ad_servers.txt
::: Testing pihole-FTL DNS: FTL started!
::: Testing lighttpd config: Syntax OK
::: All config checks passed, cleared for startup ...
::: Docker start setup complete
[i] Pi-hole blocking is enabled
[i] Neutrino emissions detected...
[✓] Pulling blocklist source list into range
[i] Target: raw.githubusercontent.com (hosts)
[✗] Status: Connection Refused
[✗] List download failed: using previously cached list
[i] Target: mirror1.malwaredomains.com (justdomains)
[✗] Status: Connection Refused
[✗] List download failed: using previously cached list
[i] Target: sysctl.org (hosts)
[✗] Status: Connection Refused
[✗] List download failed: using previously cached list
[i] Target: s3.amazonaws.com (simple_tracking.txt)
[✗] Status: Connection Refused
[✗] List download failed: using previously cached list
[i] Target: s3.amazonaws.com (simple_ad.txt)
[✗] Status: Connection Refused
[✗] List download failed: using previously cached list
[i] Target: hosts-file.net (ad_servers.txt)
[✗] Status: Connection Refused
[✗] List download failed: using previously cached list
[✓] Consolidating blocklists
[✓] Extracting domains from blocklists
[i] Number of domains being pulled in by gravity: 138226
[✓] Removing duplicate domains
[i] Number of unique domains trapped in the Event Horizon: 115995
[i] Nothing to whitelist!
[i] Number of regex filters: 0
[✓] Parsing domains into hosts format
[✓] Cleaning up stray matter
[✓] DNS service is running
[i] Pi-hole blocking will be enabled
[i] Enabling blocking
[✓] Pi-hole Enabled
[cont-init.d] 20-start.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting lighttpd
Starting crond
Starting pihole-FTL (no-daemon) as root
[services.d] done.
I tried to open 192.168.2.5/admin but it didn't work. Seems something wrong based on log file:
- WARNING Misconfigured DNS in /etc/resolv.conf: Two DNS servers are recommended, 127.0.0.1 and any backup server
WARNING Misconfigured DNS in /etc/resolv.conf: Primary DNS should be 127.0.0.1 (found 127.0.0.11)
I do have two DNS set in the yaml file, seems not taking effect?
- chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
- [✗] List download failed: using previously cached list
not sure what wrong this is?
I did follow the ubuntu instruction from the wiki page GitHub - pi-hole/docker-pi-hole: Pi-hole in a docker container. here is file /etc/resolv.conf
nameserver 192.168.2.1
Can anyone help me what setting is wrong and how to fix it?
thanks