Skip to content
name resolution for containers
Go Shell Makefile Dockerfile
Branch: master
Clone or download
Latest commit f5af33d Sep 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ci
hack
plugins/meta/dnsname use errors.Errorf instead of fmt.Errorf Sep 20, 2019
vendor consistent error handling Sep 20, 2019
.cirrus.yml
.gitignore ignore compiled binaries Sep 19, 2019
LICENSE
Makefile add vendor checks to Makefile and the CI Sep 20, 2019
README.md add podman minitutorial Sep 20, 2019
README_PODMAN.md
go.mod
go.sum go mod tidy Sep 20, 2019

README.md

dnsname plugin

Overview

This plugin sets up the use of dnsmasq on a given CNI network so that Pods can resolve each other by name. When configured, the pod and its IP address are added to a network specific hosts file that dnsmasq will read in. Similarly, when a pod is removed from the network, it will remove the entry from the hosts file. Each CNI network will have its own dnsmasq instance.

The dnsplugin plugin was specifically designed for the Podman container engine. Follow the mini-tutorial to use it with Podman.:w

Usage

The dnsname plugin can be enabled in the cni network configuration file.

{
    "cniVersion": "0.4.0",
    "name": "cni-bridge-network",
    "plugins": [
      {
        "type": "bridge",
        "bridge": "cni0",
        ...
        }
      },
      {
        "type": "dnsname",
        "domainName": "foobar.com"
      }
    ]
}

DNSMasq configuration files

The dnsmasq service and its configuration files are considered to be very fluid and are not meant to survive a system reboot. Therefore, files are stored in /run/containers/cni/dnsname. The plugin knows to recreate the necessary files if it detects they are not present.

DNSMasq default configuration

Much like the implementation of DNSMasq for libvirt, this plugin will only set up dnsmasq to listen on the network interfaces associated with the CNI network. The DNSMasq services are not configured or managed by systemd but rather only by the plugin itself.

You can’t perform that action at this time.