No description
  • Go 84.1%
  • Makefile 8.1%
  • Shell 7.4%
  • Dockerfile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
openshift-merge-bot[bot] bdc4ab8526
Merge pull request #128 from Luap99/eol
Readme: say that the repo is unmaintained
2023-11-27 16:24:37 +00:00
.github Add renovate.json 2023-04-04 11:11:11 -04:00
ci Cirrus: Add modern get_ci_vm support 2021-04-13 13:57:13 -04:00
example Improve documentation of use with Podman 2020-12-07 09:27:56 -05:00
hack Cirrus: Add modern get_ci_vm support 2021-04-13 13:57:13 -04:00
plugins/meta/dnsname Update CNI to v1.0.1 2021-09-17 16:12:11 +02:00
vendor Update module github.com/sirupsen/logrus to v1.9.2 2023-05-22 18:44:08 +00:00
.cirrus.yml Update dependency containers/automation_images to 20230517 2023-05-17 12:28:07 -04:00
.gitignore ignore compiled binaries 2019-09-19 11:36:00 -04:00
CODE-OF-CONDUCT.md Fix docs links due to branch rename 2021-06-10 11:20:46 -04:00
go.mod Update module github.com/sirupsen/logrus to v1.9.2 2023-05-22 18:44:08 +00:00
go.sum Update module github.com/sirupsen/logrus to v1.9.2 2023-05-22 18:44:08 +00:00
LICENSE initial cirrus file 2019-09-17 15:40:22 -05:00
Makefile Bump golangci-lint version due to panic 2023-03-15 10:37:22 -04:00
OWNERS add owners file 2020-08-20 07:50:05 -05:00
README.md Readme: say that the repo is unmaintained 2023-11-27 17:08:50 +01:00
README_PODMAN.md Security fix for AppArmor instructions 2021-09-18 14:08:14 +02:00
RELEASE_NOTES.md Bump to v1.3.1 2021-08-17 16:05:35 -04:00
SECURITY.md Fix docs links due to branch rename 2021-06-10 11:20:46 -04:00

dnsname plugin

IMPORTANT

As of 2023, this repository is no longer actively maintained. Our development efforts are happening in netavark and aardvark-dns that should provide a better alternative.

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 reads 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 dnsname plugin was specifically designed for the Podman container engine. Follow the mini-tutorial to use it with Podman.

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",
        "capabilities": {
            "aliases": true
        }
      }
    ]
}

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, or under $XDG_RUNTIME_DIR/containers/cni/dnsname if XDG_RUNTIME_DIR is specified. 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.

Network aliases

The dnsname plugin is capable of not only adding the container name for DNS resolution but also adding network aliases. These aliases are also added to the DNSMasq host file.

Reporting issues

If you are using dnsname code compiled directly from github, then reporting bugs and problem to the dnsname github issues tracker is appropriate. In the case that you are using code compiled and provided by a Linux distribution, you should file the problem with their appropriate bug tracker (bugzilla/trackpad).