#!/bin/bash # Turns a fresh Debian/Ubuntu machine (a VM or container you can throw # away) into a test bed for Jarl: # # * installs BIND 9 (bind9, bind9-utils, bind9-dnsutils) and what building # Jarl needs (make, git, curl, and Go from go.dev at the version go.mod # asks for, unless a new enough go is already installed); # * writes a typical hand-made BIND configuration for Jarl to import: # ACLs, options, an "internal" view (this machine's networks, with # recursion) and an "external" view (everyone else, authoritative only), # the zone in both views with different answers (split horizon), a # reverse zone for this machine's /24, and the zones in # /etc/bind/zones with comments, $TTL, $ORIGIN, $GENERATE and most # record types; # * checks it with named-checkconf -z, (re)starts named and asks it a few # questions with dig. # # Run as root from the repository root: # # sudo scripts/testenv.sh # # then build and install Jarl and adopt the configuration (the script # prints the steps at the end). # # Settings (environment): # JARL_TEST_ZONE the zone (default: example.com) # JARL_TEST_IP this machine's address in the zone (default: the # address of the default route) # JARL_TEST_VIEWS no: no views, just the zones (default: yes) # JARL_TEST_FORCE 1: also overwrite a configuration Jarl already adopted # # The current /etc/bind is saved in /root/bind-before-testenv-