Official AdGuarHome docker with both DoH (DNS over HTTPS) and DoT (DNS over TLS) clients. Don't browse the Internet insecurely by sending your DNS requests in clear text !
GPL-3.0 License
Don't forget to replace <path_to_data>
to your docker data directory.
<path_to_data>
to your docker data directory.192.168.1.110
IP address to your AdGuardHome server IP address.192.168.1.0/24
subnet to your network subnet.192.168.1.1
gateway to your network gateway.192.168.1.100/28
subnet to your macvlan subnet.192.168.1.100
IP address to your host IP address.eth0
to your network interface name.version: "2" # Docker Compose version for Portainer
services:
adguardhome:
image: oijkn/adguardhome-doh-dot:latest
container_name: adguardhome
hostname: rpi-adguard
environment:
- PUID=1000 # User ID (UID)
- PGID=100 # Group ID (GID)
- TZ=Europe/Paris # Timezone
volumes:
- <path_to_data>/adguardhome/conf:/opt/adguardhome/conf
- <path_to_data>/adguardhome/work:/opt/adguardhome/work
cap_add:
- NET_ADMIN
networks:
macvlan0:
ipv4_address: 192.168.1.110 # IP of the container for AdGuardHome
restart: unless-stopped
networks:
macvlan0:
driver: macvlan
driver_opts:
parent: eth0 # Parent interface, configure it depending on your interface name
ipam:
config:
- subnet: 192.168.1.0/24 # Subnet of the container
gateway: 192.168.1.1 # Gateway of the network
ip_range: 192.168.1.100/28 # Usable Host IP Range: 192.168.1.97 - 192.168.1.110
aux_addresses:
rpi-srv: 192.168.1.100 # Reserved for RPi Server (IP of the host)
2. Configure the network interface
macvlan-shim
IP, you must attribute one IP from the range of macvlan subnet# Ethernet interface (eth0)
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.110
# create a new network macvlan interface on top of eth0
pre-up ip link add macvlan-shim link eth0 type macvlan mode bridge
# assign an IP and the network space to the new network interface
pre-up ip addr add 192.168.1.99/32 dev macvlan-shim
# bring up the new network interface
up ip link set macvlan-shim up
# add a route to the container
post-up ip route add 192.168.1.110/32 dev macvlan-shim
3. Configure the DNS resolver
You must configure the new nameserver
of your host.
Edit the file /etc/resolv.conf
as below :
nameserver 192.168.1.110 # AdGuardHome server IP address
docker-compose up -d
http://<AdGuardHome_Server_IP>:3000/
IMPORTANT
: In Listen Interfaces option choose eth0
(or another name, it depends on your system) and select nextusername
& password
and then login admin panel (port :80)IMPORTANT
: In general settings, set "Query logs retention" to 24 hours. (I read that for some people logs fill up which slows down Pi and needing a reboot)127.0.0.1:53
127.0.0.1:5053
(Cloudflared tunnel)127.0.0.1:8053
IMPORTANT:
Check "Parallel Request" option for DNS resolvers to work simultaneously.If you have any problems with or questions about this image, please contact me through a GitHub issue.