How arnested/ldddns works
Main Components
a) Core Components:
• Docker Host System
• ldddns Service (Main Service)
• Docker Engine/API
• mDNS Broadcasting System
• DNS-SD Service Discovery
b) Integration Points:
• Container Monitoring System
• Hostname Management System
• Configuration Management
┌─ Host System ──────────────────────────────────────┐
• ┌─ ldddns Service ───────────────────────────┐ │
• ┌─ Container Monitor ─┐ ┌─ Hostname ─┐ │ │
• Manager │ │ │
• ┘ └───────────┘ │ │
• ┌─ mDNS Broadcaster ─┐ ┌─ DNS-SD ─┐ │ │
• Service │ │ │
• ┘ └─────────┘ │ │
• ┘ │
• ┌─ Docker Engine ─────────────────────────────┐ │
• ┌─ Container 1 ─┐ ┌─ Container 2 ─┐ │ │
• ┘ └───────────────┘ │ │
• ┘ │
• ┘
Key Interactions to Highlight
a) Configuration Flow:
• How the service reads configuration from systemd environment variables
• Hostname lookup sources (env vars, container names, labels)
b) Container Monitoring:
• Connection between ldddns and Docker Engine API
• Container event monitoring
c) DNS Broadcasting:
• How hostnames are broadcast via mDNS
• DNS-SD service discovery for exposed ports
Important Details
• Configuration options (LDDDNS_HOSTNAME_LOOKUP, LDDDNS_IGNORE_DOCKER_COMPOSE_ONEOFF)
• Hostname rewriting rules (.local TLD requirement)
• Service discovery limitations (one domain per service per container)
• Port mapping for DNS-SD
Implementation Notes
• Main service logic (main.go)
• Container management (container.go, internal/container/)
• Hostname handling (internal/hostname/)
• Logging system (internal/log/)
Remember to include:
• Systemd integration points
• Security boundaries
• Configuration file locations
• Update mechanism through APT
This system design should provide a clear understanding of how ldddns integrates with both Docker and the local network infrastructure while maintaining its primary purpose of providing convenient local DNS resolution for Docker containers.