Pihole v6 & unbound in one Docker-Container

Hello Community,

there are some projects where Pihole in v5 was built together with unbound in ONE docker container, so you don't have to build macvlan.

Does anyone know of a project where this 1-container solution was implemented with the new v6 of Pihole?

Or are the developers perhaps planning to release such an installation "out of the box"?

Best regards
Gerd

You don't need to use macvlan to use unbound in a separate container.

You just need to set the correct ports to avoid conflicts between the containers and host.

Thank you for your support!

You mean, i can use a bridge-network from docker with two separat containers - one for pihole and one for unbound?

Have you a compose example for this setup?

TIA
Gerd

Personally I don't have a example, but this repository has one:

You can use the same logic with different images.

Also, you can probably find other examples on the internet.

This docker-compose seems to complicated IMO. While this may work you should mind that Pi-hole also accepts hostnames (not only IP addresses) as upstream servers. You can omit the entire IP address definition and the complicated network configuration and simply specify unbound as the DNS server using the pihole container's environment.

Maybe something like this:

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:development-v6
    networks:
      - pihole-unbound
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      TZ: 'America/Chicago'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'correct horse battery staple'
      # Configure DNS upstream servers, e.g:
      FTLCONF_dns_upstreams: 'unbound'
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole:/etc/pihole'
    restart: unless-stopped

  unbound:
    image: mvance/unbound:latest
    networks:
      - pihole-unbound
    restart: unless-stopped

networks:
  pihole-unbound:

Please refer to GitHub - pi-hole/docker-pi-hole at development-v6 for any details about the pihole configuration part.

HINT: This configuration assumes you are working with the v6.0 beta. Replace development-v6 by latest, etc. once Pi-hole v6.0 has been merged!

Hi,
thank you for your support!

I take your compose file.

But i get this warning in the ftl.log

WARNING WARNING in dnsmasq core: no address range available for DHCP request via eth0

My compose file:

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:development-v6
    networks:
      - pihole-unbound
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
      - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
    environment:
      TZ: 'Europe/Berlin'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'MyWebServerApiPassword'
      # Configure DNS upstream servers, e.g:
      FTLCONF_dns_upstreams: 'unbound'
    # Volumes store your data between container upgrades
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    restart: unless-stopped
    labels:
      - com.centurylinklabs.watchtower.enable=true
    cap_add:
      - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed

  unbound:
    image: mvance/unbound:latest
    container_name: unbound
    networks:
      - pihole-unbound
    restart: unless-stopped
    labels:
      - com.centurylinklabs.watchtower.enable=true

networks:
  pihole-unbound:
    name: pihole-unbound

Can you help me please?

TIA

Regards
Gerd

Are you using DHCP?

Yes, I using pihole as DNS and DHCP server

Then have a look at GitHub - pi-hole/docker-pi-hole at development-v6 concerning DHCP. It may not be possible to do the same with host networking mode due to docker limitations.