Local Docker DNS for Development purpose only

Mohamed Moughamir
Andiro

--

Photo by Sabbir Rahaman on Unsplash

Won’t be great to have easy to setup local DNS for your docker containers, in this short article I’ll share with you quick steps to setup a local docker development dns with ldddns.

Quick Setup

run the following in your terminal emulator :

curl -fsSL https://ldddns.arnested.dk/install.sh | bash

Configuration

create service config /etc/systemd/system/ldddns.service.d/override.conf
with the following entries:


[Service]
Environment=LDDDNS_HOSTNAME_LOOKUP=env:VIRTUAL_HOST,containerName
Environment=LDDDNS_IGNORE_DOCKER_COMPOSE_ONEOFF=true

Explanation

You can configure where the service should look for hostnames:

  • Environment variables : env:<VAR_NAME>
  • Container name : containerName
  • Labels: label:<label.name>

--

--

Mohamed Moughamir
Andiro
Editor for

an instance of human class, unveiler and experience designer.