Skip to content

Bug: DNS server being overridden by AdGuard Home #3217

Description

@kibunchininumunu

Is this urgent?

No

Host OS

Debian Bookworm

CPU arch

x86_64

VPN service provider

Mullvad

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version latest built on 2026-03-08T23:33:15.231Z (commit 069cde8)

What's the problem 🤔

Problem

I'm not sure if this is the right place to put this, but I had an issue where DNS queries originating from Transmission behind Gluetun seemed to be leaking in plaintext (visible in the AdGuard Query Log), despite having a relatively straightforward configuration. In my network, AdGuard Home is running on a router that is a separate machine from the Docker host. Based on the target DNS server described in the queries, I think AdGuard was somehow forcing the upstream DNS server specified in its settings onto Docker, which then got inherited by the Gluetun container. (This is my best guess as to what was happening.)

I tried various attempts to fix it based on other similar issues, but nothing worked. Things I attempted include the following:

  • Setting DNS_SERVER to on
  • Setting DNS_UPSTREAM_RESOLVER_TYPE to dot or doh
  • Setting DNS_ADDRESS to 127.0.0.1
  • Setting DNS_KEEP_NAMESERVER to off
  • Waiting and then manually starting the containers to be routed through Gluetun after the Gluetun container was already spun up (this reduced the number of leaked queries, but some still trickled through)

Solution

None of these solutions work, so I eventually tried specifying the dns option in my compose file, and that finally seemed to work! I set it to 127.0.0.1 so that it would loop back and explicitly use Gluetun's internal DNS server, rather than inheriting anything from Docker or another external source.

I just wanted to share my solution in case someone else ends up struggling with a similar situation in the future.

Suggestion

Perhaps the dns: 127.0.0.1 line could be included in example compose files in the wiki? I'm unaware of any downsides of including the setting explicitly, even though it may be redundant in many cases.

Share your logs (at least 10 lines)

I do not have any logs to share that are relevant to the issue described.

Share your configuration

services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    volumes:
      - /media/john/mediastuff/appdata/gluetun:/gluetun
      - /home/john/docker/compose/info/.mullvad_wireguard.conf:/gluetun/wireguard/wg0.conf
    ports:
      - 9091:9091 # transmission
    dns: 127.0.0.1
    environment:
      - VPN_SERVICE_PROVIDER=mullvad
      - VPN_TYPE=wireguard
      - SERVER_CITIES=Stockholm
      - TZ=America/Phoenix
    restart: always

  transmission: #port=9091
    image: lscr.io/linuxserver/transmission:latest
    container_name: transmission
    network_mode: "service:gluetun"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Phoenix
    volumes:
      - /media/john/mediastuff/appdata/transmission:/config
      - /media/john/mediastuff/data/torrents:/data/torrents
      - /media/john/mediastuff/data/torrents/watch:/data/torrents/watch
    restart: unless-stopped

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions