DEV Community

Zen Oh
Zen Oh

Posted on

How to Setup DNS Manager in Proxmox Using AdGuard Home

First, make sure you have Ubuntu container template in Proxmox.
Create container using Ubuntu container template

Setup the Container

Do updates in container:

apt update
apt upgrade
Enter fullscreen mode Exit fullscreen mode

Follow this documentation to install Docker inside your Ubuntu:
https://docs.docker.com/engine/install/ubuntu/

Remove the built in DNS service

This is the command to remove the Ubuntu built in DNS service:

  1. Create the directory
sudo mkdir -p /etc/systemd/resolved.conf.d
Enter fullscreen mode Exit fullscreen mode
  1. Create configuration file
sudo nano /etc/systemd/resolved.conf.d/adguardhome.conf
Enter fullscreen mode Exit fullscreen mode
  1. Paste this into the file
[Resolve]
DNS=127.0.0.1
DNSStubListener=no
Enter fullscreen mode Exit fullscreen mode
  1. Create symbolic link
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Enter fullscreen mode Exit fullscreen mode
  1. Restart the service
sudo systemctl reload-or-restart systemd-resolved
Enter fullscreen mode Exit fullscreen mode

Run AdGuard Home

Create a directory where you want to store the docker compose file and AdGuard Home configurations, then move to that directory.

Create docker-compose.yml file:

services:
  adguardhome:
    container_name: adguardhome
    image: adguard/adguardhome
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./work:/opt/adguardhome/work
      - ./conf:/opt/adguardhome/conf
Enter fullscreen mode Exit fullscreen mode

Run the script:

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

The AdGuard Home management will run on port 3000.

Make sure you set this container as DNS server for your future VM / Container inside Proxmox that want to use this custom DNS server.

Top comments (0)