dockur / dnsmasq

Dnsmasq DNS server in a Docker container.
MIT License
17 stars 4 forks source link

The Docker container does not open in the browser #5

Open gildembergleite opened 1 month ago

gildembergleite commented 1 month ago

I have the following problem

I started my Docker container using the docker-compose.yml file below:

version: "3.8"

name: 'net'

services:
  cloudflared:
    image: visibilityspots/cloudflared:latest
    container_name: cloudflared
    restart: unless-stopped
    environment:
      - UPSTREAM1=https://1.1.1.1/dns-query
      - UPSTREAM2=https://1.0.0.1/dns-query
      - PORT=5054
      - ADDRESS=0.0.0.0
      - METRICS=127.0.0.1:8088
    network_mode: host

  pihole:
    image: pihole/pihole:latest
    container_name: pihole
    restart: unless-stopped
    depends_on:
      - cloudflared
    environment:
      - DNSMASQ_USER=pihole
      - WEBPASSWORD=ekCiN8!8b8ciNt2YmFAER
      - TZ=America/Sao_Paulo
      - PIHOLE_DNS_=127.0.0.1#5054
      - WEB_PORT=8053
    volumes:
      - /home/gildembergleite/dnsmasq.d:/etc/dnsmasq.d
      - /home/gildembergleite/pihole:/etc/pihole
    network_mode: host
    cap_add:
      - NET_RAW

  dnsmasq:
    image: dockurr/dnsmasq:latest
    container_name: dnsmasq
    environment:
      DNS1: "1.0.0.1"
      DNS2: "1.1.1.1"
    ports:
      - 53:53/udp
      - 53:53/tcp
      - 67:67/udp
    cap_add:
      - NET_ADMIN

But when I try to access the container URL, I get the following message in the browser:

This site can’t be reachedThe webpage at http://localhost:53/ might be temporarily down or it may have moved permanently to a new web address. ERR_UNSAFE_PORT

kroese commented 1 month ago

The port 53 is the port used for DNS traffic, but you try to open it in a web browser. So it is normal that it does not open because there is no web UI for this container, like Pi-hole has for example.

In fact, I am not even sure what you are trying to do, because Pi-hole already contains its own copy of dnsmasq, so there is not really any need to run your own copy of dnsmasq anymore, if you already run the Pi-hole container.