How to Start Bind9 DNS Server with Rancher Desktop


I am trying to start a simple Bind9 DNS server using a Docker Compose file and Rancher Desktop 1.14.1 (with the dockerd container engine) on a Windows 11 machine. Although this setup runs without issues on Docker, I encounter the following error when running it with Rancher Desktop:

Error response from daemon: driver failed programming external connectivity on endpoint bind9 (1e7d2766ea4f8c9c8dceffbe758e9c48144ced5a78b4f04623e0cf1a582a847c): Error starting userland proxy: listen tcp4 bind: address already in use

Compose file:

version: '3'
    image: ubuntu/bind9:9.18-22.04_beta
    container_name: bind9
      - BIND9_USER=root
      - TZ=TZ=Europe/Berlin
      - "53:53/tcp"
      - "53:53/udp"
      - ./config:/etc/bind
      - ./cache:/var/cache/bind
      - ./records:/var/lib/bind
    restart: unless-stopped

There are no other running containers. While I can change port 53 to a different port, this prevents the container from receiving DNS traffic. Is there a workaround for this issue or can I somehow make the port 53 to be usable like with Docker?

rancher desktop runs in a k8s env, so there is a dns service (typically coredns) running. You need to bind port 53 of bind9 to another port in the service and create a loadbalancer service in the rancher k8s cluster that exposes it to the outside. (or you can try to run it with host network)

Thank you for the answer.
I have no experience with k8s, do you have an example how to achieve that?