A lightweight DNS server that automatically resolves domains for Docker containers based on labels.
Miyo acts as a DNS proxy that dynamically registers domains from running Docker containers. Any container with a dns.domain label will have its domain automatically resolved to your host's IP address. All other DNS queries are forwarded to an upstream DNS server.
- Automatic DNS record registration via Docker container labels
- Real-time container event monitoring (create/kill)
- DNS proxy with configurable upstream server
- Dockerized deployment
- Clone the repository:
git clone <repository-url>
cd miyo- Build the image:
docker build -t miyo .- Run with Docker Compose:
docker compose up -d- Configure your system or router to use Miyo as the DNS server (default port:
8080mapped to container port53).
| Variable | Description | Default |
|---|---|---|
HOST_ADDRESS |
The IP address returned for registered container domains | 127.0.0.1 |
UPSTREAM_DNS |
Upstream DNS server for non-registered domains | 1.1.1.1 |
UPSTREAM_DNS_PORT |
Upstream DNS server port | 53 |
Add the dns.domain label to any Docker container:
docker run -d --label dns.domain=myapp.local nginxWith Docker Compose:
services:
myapp:
image: nginx
labels:
- dns.domain=myapp.localThe domain myapp.local will automatically resolve to the configured HOST_ADDRESS.
- Docker
- Docker Compose (optional)
- Python 3.10+ (for local development)
See LICENSE for details.