Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

cisagov/coredns-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coredns-docker 📔🐳

GitHub Build Status CodeQL Known Vulnerabilities

Docker Image

Docker Pulls Docker Image Size (latest by date) Platforms

This is a docker project that is used to spin up a CoreDNS server.

CoreDNS Configuration

CoreDNS uses a configuration file Corefile to specify what servers listen on which port(s), the protocols used by the server, and for which zone the server is authoritative. This file is located at config/Corefile and is mounted to /root when the CoreDNS container is ran.

Corefile

A minimal Corefile is included in this repository and can be configured following the scheme shown below.

ZONE:[PORT] {
  [PLUGIN]...
}

A list of plugin(s) used by the CoreDNS

Running

Running with Docker

To run the cisagov/coredns image via Docker:

docker run cisagov/coredns:latest

Running with Docker Compose

  1. Modify the docker-compose.yml file similar to the one below to use Docker Compose.

    ---
    version: "3.7"
    
    services:
      redirect-dns:
        # Run the container normally
        build:
          # VERSION must be specified on the command line:
          # e.g., --build-arg VERSION=0.0.1
          context: .
          dockerfile: Dockerfile
        image: cisagov/coredns
        container_name: coredns
        init: true
        restart: on-failure
        volumes:
          - './config:/root'
  2. Start the container and detach:

    docker compose up --detach

Updating your container

Docker Compose

  1. Pull the new image from Docker Hub:

    docker compose pull
  2. Recreate the running container by following the previous instructions:

    docker compose up --detach

Docker

  1. Stop the running container:

    docker stop <container_id>
  2. Pull the new image:

    docker pull cisagov/coredns:latest
  3. Recreate and run the container by following the previous instructions.

Volumes

Mount point Purpose
./config:/root Specifies the addresses for redirection

Ports

The following ports are exposed by this container:

Port Purpose
53 listening for DNS queries

The sample Docker composition publishes the exposed port at 53.

Environment variables

Required

There are no required environment variables.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

This project is in the worldwide public domain.

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.