safing/portmaster

Docker containers cannot resolve DNS when Portmaster is active

Opened this issue · 1 comments

Description

I am running SearXNG with Docker Compose (services: searxng, redis, caddy).
When Portmaster is running, SearXNG containers cannot resolve hostnames (e.g., duckduckgo.com), leading to Search error in the UI.

When Portmaster is stopped, everything works correctly.

Steps to reproduce

  1. Install Portmaster (system-wide DNS handling enabled).

  2. Run SearXNG with Docker Compose (searxng, redis, caddy).

  3. Open the SearXNG UI (http://127.0.0.1:8080/)

  4. Perform a search → results in “Search error”.

  5. Inside the container:
    $ docker exec -it searxng ping -c 3 duckduckgo.com
    -> ping: bad address 'duckduckgo.com'
    $ docker exec -it searxng ping -c 3 1.1.1.1
    -> works fine

This shows DNS resolution is failing, but raw IP connectivity works.

Stopping Portmaster → DNS resolution works again inside containers, and SearXNG works.

What has been tested / tried

DNS in Docker
Added explicit DNS servers in docker-compose.yaml:
dns:

  • 1.1.1.1
  • 9.9.9.9

→ No effect while Portmaster is active.

Host networking

Confirmed caddy is already running in network_mode: host.

Question

Is there a way to make Portmaster and Docker containers coexist, specifically for DNS resolution?

Should I configure Portmaster differently (e.g., disable DoH for Docker traffic, or allow Docker’s embedded DNS)?

Greetings and welcome to our community! As this is the first issue you opened here, we wanted to share some useful infos with you:

  • 🗣️ Our community on Discord is super helpful and active. We also have an AI-enabled support bot that knows Portmaster well and can give you immediate help.
  • 📖 The Wiki answers all common questions and has many important details. If you can't find an answer there, let us know, so we can add anything that's missing.