Rootless docker resolve clients

Hello there,

I'm trying to setup pihole on my rootless docker setup. It's working beside of the clients which are not resolved. The only one ip shown is the gateway of the docker default bridge network.

I've tried adding some additional capabilities listed here but sadly I'm still without any success.

It's a clean debian bullseye setup with only rootless docker, docker compose plugin and pihole installed.

Just to add pihole on docker with root can resolve clients. I'm using pihole together with fritzbox and I do use pihole as my dns server. I actually also don't want to use my pihole as dhcp server - at least for now.

docker-compose.yml

version: "3"

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:2023.03.1
    environment:
      WEBPASSWORD: abcdef
      TZ: 'Europe/Berlin'
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "8080:80/tcp"\
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      - CAP_NET_BIND_SERVICE
      - CAP_NET_RAW
      - NET_ADMIN # only for dhcp
    restart: unless-stopped

debug_log.txt (24.0 KB)

Docker version 24.0.1, build 6802122
Docker Compose version v2.18.1

Any advices appreciated, thank you in advance :slight_smile:

It is sometimes like that - when you sum up your problems then you will find the solution by an accident.

The solution is to use port driver slirp4netns. This can be done by creating a new file in

~/.config/systemd/user/docker.service.d/override.conf

with following

DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=slirp4netns

don't remember to restart your docker and you're almost done - you also will have to do following

sudo sh -c "echo 0 > /proc/sys/net/ipv4/ip_unprivileged_port_start"

Credits to those awesome guys here Rootless mode overwrites public IP to Docker's IP · Issue #41789 · moby/moby · GitHub