Skip to content

Latest commit

 

History

History

Implementations

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Serving a Zone File with an Implementation

  1. Build the image of the required implementation using:

    docker build -t <image_name>:oct -f <directory_name>/Dockerfile .

    where, the image_name would be bind and directory_name would be Bind to build a Bind image.
    Please note:

    • Use the image_name same as the directory_name but in lowercase.
    • Each Docker image consumes ~ 1-2 GB of disk space.
    • Technitium implementation does not have the corresponding Oct, 2020 version, and only the latest commit is used for any build.

    By default, the image built uses the code around October 1st, 2020. The links to the exact commit used are as follows:

    Bind  ·  Nsd  ·  Knot  ·  PowerDns  ·  CoreDns  ·  Yadifa  ·  MaraDns  ·  TrustDns

    To build the image using the latest main branch, pass true to the build argument latest⚠️:

    docker build -t <image_name>:latest -f <directory_name>/Dockerfile --build-arg latest=true .
  2. Serve a zone file with an implementation using python3 main.py.

     usage: main.py [-h] [-z ZONE_FILE_PATH] [-c CONTAINER_NAME]  [-p UNUSED_PORT] [-i {bind, nsd, knot, powerdns, coredns, yadifa, maradns, trustdns}] [-l] [-e]
    
     Gets an implementation to serve the input or default zone file.
     Specify an image name and a port to start a new container (also container name if you want to assign a name)
       or only the name of an existing container to reuse it.
    
     optional arguments:
     -h, --help                              Show this help message and exit.
     -z ZONE_FILE_PATH                       The path to the zone file to be served. (default: db.campus.edu)
     -i {bind, nsd, knot, powerdns,
         coredns, yadifa, maradns, trustdns} The docker image name of the implementation to start a container.
     -p UNUSED_PORT                          An unused host port to map to port 53 of the container.
     -c CONTAINER_NAME                       A name for the container. (default: Random Docker generated name)
     -l, --latest                            Serve using the latest image tag.
     -e                    Whether the implementation is Technitium. (default: False)
     
  3. Query from the host machine using:

    dig @127.0.0.1 -p <PORT> +norecurse <QUERY>

    where PORT is the port number used in the previous step to start a container.

⚠️ The image may not build with the latest code if dependecies or other things are updated after Oct 1st, 2020.