Sign inSign up

raphaeljaeger/dnsgate

By raphaeljaeger

•Updated 18 days ago

Image
Networking
0

592

raphaeljaeger/dnsgate repository overview

⁠DNSGate

DNSGate is a lightweight web-based management GUI for CoreDNS.

It provides an easy way to manage a CoreDNS instance through a web interface without requiring direct editing of the Corefile and hosts configuration.

The CoreDNS server can optionally be created and managed directly by DNSGate. However, CoreDNS runs independently from the GUI and continues serving DNS requests even if the DNSGate container is stopped or removed.

⁠Features

  • 🌐 Web-based GUI for CoreDNS
  • 🚀 Optional automatic creation and management of a CoreDNS container
  • 🔄 CoreDNS continues running independently from DNSGate
  • ⚙️ Manage CoreDNS configuration through the GUI
  • 🟢 DNS allowlisting / whitelisting
  • 🔴 DNS blocklisting / blacklisting
  • 🔀 DNS rewrites
  • 📡 Forward specific domains or DNS requests to different upstream DNS servers
  • 💾 SQLite-based configuration and database
  • 🐳 Docker-based deployment
  • 🔧 Automatically reuses the existing configuration when recreating the CoreDNS container

⁠How it works

DNSGate consists of two containers:

  • DNSGate GUI – provides the web interface and manages the configuration.
  • CoreDNS – handles the actual DNS requests.

The CoreDNS container is optional and can be created by DNSGate itself.

When DNSGate creates or recreates the CoreDNS container, the existing CoreDNS configuration and hosts files managed by DNSGate are mounted into the new container. This means the configuration is preserved across container recreation.

The CoreDNS container does not depend on the GUI being available at runtime. Once CoreDNS is running, it can continue serving DNS requests independently.

⁠Configuration

Example docker-compose.yml:

services:
  gui:
    build: .
    container_name: dnsgate-gui
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      COOKIE_SECURE: "false"
      TRUST_PROXY: "false"
      DNS_CONTAINER_NAME: "dnsgate-dns"
      DNS_IMAGE: "coredns/coredns:1.12.1"
      SELF_CONTAINER: "dnsgate-gui"
    volumes:
      - ./data:/data
      - ./config:/config
      - /var/run/docker.sock:/var/run/docker.sock
⁠Environment Variables
VariableDescription
COOKIE_SECURESet to true when the GUI is served over HTTPS.
TRUST_PROXYSet to true when running behind a reverse proxy that provides X-Forwarded-For.
DNS_CONTAINER_NAMEName of the CoreDNS container managed by DNSGate.
DNS_IMAGECoreDNS Docker image to use.
SELF_CONTAINERName of the DNSGate GUI container.

⁠Volumes

PathPurpose
/dataSQLite database
/configCoreDNS configuration and hosts files
/var/run/docker.sockAllows DNSGate to create, start, stop and remove the managed CoreDNS container

Security note: Mounting /var/run/docker.sock gives the container extensive control over the Docker host. Only use this feature when you trust the DNSGate image and its configuration.

⁠DNS Management

DNSGate supports several common DNS management functions:

⁠Allowlisting & Blocklisting

Control which domains are allowed or blocked through DNS.

⁠DNS Rewrites

Create custom DNS responses for specific domains, for example:

internal.example.com → 192.168.10.50

This can be useful for internal services and local DNS records.

⁠Conditional Forwarding

Forward specific domains or DNS requests to dedicated upstream DNS servers while using another resolver for everything else.

This makes DNSGate suitable for home labs, self-hosted environments, internal networks and small infrastructure deployments.

DNSGate is the management layer. CoreDNS remains the actual DNS server.

Tag summary

Content type

Image

Digest

sha256:87f6db818…

Size

9.7 MB

Last updated

18 days ago

docker pull raphaeljaeger/dnsgate