When loading coredns
configuration the test-zone-data directory should be
the working directory, else it will not find all included data files. That
directory structure holds directories with zone files and coredns
configurations
for the test zone scenarios.
- Only Ubuntu 22.04 is supported.
- Install Zonemaster-CLI on the computer. Install current develop branch or the
latest version of Zonemaster (it will not work with older version than v2022.2,
first version with support for
--hint
). - Clone this repository or copy its contents to the computer.
- Install
go
(here version 1.20 is assumed):sudo apt install golang-go
- Install
unbound
sudo apt install libunbound-dev
- Install
coredns
:- Reference https://github.com/coredns/coredns
- Clone
coredns
:
git clone https://github.com/coredns/coredns cd coredns
- Add the line "unbound:github.com/coredns/unbound" to the plugin.cfg file found in the top of the repository, e.g.
echo "unbound:github.com/coredns/unbound" >> plugin.cfg
- Add support for CHAOS class in more plugins. In
coredns/core/dnsserver/server.go
findEnableChaos
at the end of the file. Add "template" and "acl" to the plugins that accepts CHAOS class. For reference see coredns/coredns#6373 - Generate and compile
go get github.com/coredns/unbound go generate CGO_ENABLED=1 make
coredns
is now in top of repository. Add it to PATH and repeat this step every timecoredns
is recompiled (or create a symlink instead).
sudo cp coredns /usr/local/bin/
Two terminal windows to the computer are needed.
- Change to the test-zone-data directory (where this README file is).
- If new IP addresses have been taken into use, address-plan.md must be updated.
- Create all virtual interfaces. This step has to be done once for each session
or again if additional interfaces have been added. (Reboot the computer to
remove the interfaces, if needed.)
./set-ip.sh
- Start
coredns
. It will be running in the foreground until terminated.sudo coredns --conf main.cfg
- Change directory to where this README file is.
- Use
zonemaster-cli
with--hint
and the appropriate name.root hint file. Examplewith outputzonemaster-cli UNEXPECTED-RCODE-MX.zone09.xa --raw --test Zone/zone09 --hints COMMON/hintfile --level info
0.00 INFO GLOBAL_VERSION version=v4.5.1 0.07 WARNING Z09_UNEXPECTED_RCODE_MX ns_ip_list=ARRAY(0x5638fec55130); rcode=NOTIMPL 0.07 NOTICE Z09_MISSING_MAIL_TARGET
For more examples and information on how to interpret the example above, go to section “Directories” below, find the test module, then the test case within the module, and read the test case’s README file.
Unit tests based on these test zones for Zonemaster-Engine can now be run in terminal 2 and the data can be recorded and saved as data files. See the t directory in Zonemaster-Engine for more details.
The following files are found in this directory, i.e. the same directory as this README file.
- main.cfg
- The default main
coredns
configuration file that includes all other data files.
- The default main
- address-plan.md
- A document that explains the IP plan and that also contains the IP plan in a markdown table.
- set-ip.sh
- A script to populate the loopback based on the content of address-plan.md.
More files are found in the directories below.
The following directories are found in this directory, i.e. the same directory as this README file. More files and sub-directories are found in those directories.
- COMMON/
- Holds zone files and configuration that are shared between several scenarios for different test cases.
- Address-TP/ (not yet available)
- Directory structure for scenarios for test cases in the Address-TP test module.
- Basic-TP/ (not yet available)
- Directory structure for scenarios for test cases in the Basic-TP test module.
- Connectivity-TP/ (not yet available)
- Directory structure for scenarios for test cases in the Connectivity-TP test module.
- Consistency-TP/
- Directory structure for scenarios for test cases in the Consistency-TP test module.
- DNSSEC-TP/
- Directory structure for scenarios for test cases in the DNSSEC-TP test module.
- Delegation-TP/ (not yet available)
- Directory structure for scenarios for test cases in the Delegation-TP test module.
- Nameserver-TP/ (not yet available)
- Directory structure for scenarios for test cases in the Nameserver-TP test module.
- Syntax-TP/ (not yet available)
- Directory structure for scenarios for test cases in the Syntax-TP test module.
- Zone-TP/
- Directory structure for scenarios for test cases in the Zone-TP test module.