BUILDREALMS(1)
π buildrealms(1) β or, how to build your DNSSEC-Tools realms environment without losing your mind
okay so real quick, bestie: this is the manual page for buildrealms, and it lives in the User Contributed Perl Documentation section, so you already know it's giving perl-core energy. it's a whole helper tool for DNSSEC-Tools, and it's honestly iconic once you get what it's doing. let's go π
β¨ NAME β¨
buildrealms β literally here to assist you in building a DNSSEC-Tools realms environment. that's the whole job. π«Ά
πΈ SYNOPSIS πΈ
buildrealms [options] <realmsfile> <command> <command-args>
that's it. that's the shape of it. <realmsfile> goes in, a <command> goes in, the <command-args> follow along, and options sprinkle on top like glitter. β¨
π DESCRIPTION π
so. buildrealms is your bestie for setting up a realms environment that dtrealms can actually use. no cap, it does a lot:
- it creates the required file hierarchies for each realm
- it moves a realm's files to their appropriate place in the hierarchy
- it updates several files for the final destination
the realm hierarchies get built in a staging area, and that staging area is gonna hold the files for all the realms. we're talking rollrec files, keyrec files, key files, configuration files, log files, and anything else DNSSEC-Tools needs to manage key rollover. ποΈ
β οΈ afterbuildrealmscreates these files, you (yes, you, main character) should check the files to make sure they're correct. the files and directories in the staging then must be manually moved to the final directory. that final directory is wheredtrealmswill manage the various realms from. if the final directory isn't specified (via an option), then the directory in whichbuildrealmswas executed becomes the final directory. periodt.
buildrealms uses a realms file to control how it builds the realms environment. the realm entries in this file have a hoard field, and that field is only used by buildrealms. for each realm, this field's value is a directory holding the files needed by that particular realm. after building that realm, buildrealms removes the hoard entry from that realm record. and after all the realms have been built, a copy of this realms file gets moved into the staging area. cute, right? π¦
there are two operations buildrealms currently provides. both are in support of creating and maintaining a DNSSEC-Tools realms environment. this documentation describes the operations individually. π
π Realms Environment Creation
the create command builds the whole realms environment. the realm file hierarchies are built in the staging area. after buildrealms creates these files, the user should check the files to ensure that they are correct. the files and directories in the staging then must be manually moved to the final directory. if the final directory isn't specified (via an option), then the directory in which buildrealms was executed will be the final directory.
buildrealms takes the following actions when given the create command:
- A file hierarchy is created for each realm. π³
- A DNSSEC-Tools configuration file is put in each realm's hierarchy. if the
-configoption is given, then the specified configuration file will be copied to each realm. if it isn't given, then each realm's hoard will be searched for a file whose name ends with.conf. the first such file found will be used for that realm only. if such a file is not found, then the system-wide DNSSEC-Tools configuration file will be used for that realm. π - The realm's rollrec, keyrec, zone, and key files are moved into the hierarchy. the rollrec file is named in the realms file. the keyrec and signed zone files are listed in the rollrec file. the unsigned zone files and key files are listed in the keyrec file.
- A key archive is created for each realm's existing, expired keys. the key archive is placed in the realm's state directory in the staging area. archived keys, as listed in the keyrec files, are moved to this key archive. π¦
- Paths in several files are adjusted for the new hierarchy and the realm's final destination. these paths include archived keys in the realm's keyrec files, the key archive and
rollerdlog files in the realm's DNSSEC-Tools configuration file, and key directories in the keyrec files. π₯
π¦ Realms Hierarchy Creation
the trees command builds the basic directory hierarchy for each realm in the staging area. however β and this is important β no other files or directories are copied or moved in to the staging area. (yes, the original really does end that sentence with two periods. we stan a quirky queen. π)
the following directories are created for each realm:
- configuration directory β this holds the
dnssec-toolsdirectory. dnssec-toolsdirectory β this will hold the DNSSEC-Tools configuration file.- state directory β this will hold the realm's state information, including the key archive.
- realm directory β this will hold the realm's rollrec file, the keyrec files, the zone files (signed and unsigned), and the key files.
π§ PREPARING FOR EXECUTION π§
in preparing a realms file and the realm hoards for buildrealms, there are several things that should be kept in mind. lowkey this is the part you don't wanna skip:
- Use relative paths for the rollrec file and three directories in the realms file.
- All a realm's files should be stored in its hoard. they do not have to be in a particular place in the directory, as long as the rollrec and keyrec files are accurate. β¨
- At the end of the creation process, the realms file will be copied into the top level of the staging area.
- After specific files (e.g., rollrecs, keyrecs, etc.) are moved into a realm's part of the staging area, the remaining files in the hoard will be moved into the realm's
realmdirpart of the staging area. the hierarchical organization of the remaining hoard files will be preserved. ποΈ - The contents of a keyrec's archive directory in the realm's hoard, as defined by the
archivedirfield, will be moved to<statedir>/key-archivein the staging area. - The configuration file for a realm will be put in
<configdir>/dnssec-tools/<conffile>in the staging area. the actual name of the configuration file (given here as<conffile>) will depend on how the configuration file is found. if the system-wide DNSSEC-Tools file is used, then the name will bednssec-tools.conf. if the-configoption is used, then the name used with the option will be used. if a.conffile is found in the realm's hoard, then the full filename will be used. π
π WARNINGS π
root is not allowed to runbuildrealms. some of the actions taken bybuildrealmscan be devastating if a misconfigured (or maliciously constructed) realm file is used to control construction. like, don't do it. fr fr. π
buildrealms is not clairvoyant. it does the best it can, but it is a general tool. the resulting realms should be checked to ensure they are set up as desired. in particular, you should check the realm file rollrec files, keyrec files, and configuration file. π
no reverse functionality has been implemented, so once run, the files are modified, moved, and copied. it might not be a bad idea to back up your files prior to running buildrealms, just in case... π
π COMMANDS π
createβ thecreatecommand builds the whole realms environment.buildrealmstakes the following actions when given this command:treesβ thetreescommand builds the basic directory hierarchy for each realm. the following directories are created for each realm:
π OPTIONS π
-actionsβ display the file actions taken bybuildrealms. this includes directory creations, file copies, and file moves. if used in conjunction with the-nobuildoption,buildrealmswill not perform the actions, but will display the actions that would otherwise have been taken. π-clearβ this flag indicates thatbuildrealmsshould delete the current staging area and its contents prior to building the realms. π§Ή-configconffile β conffile is the DNSSEC-Tools configuration file to copy for each realm.-directorytarget β target is the target directory for the realms to be built bybuildrealms. the new realms will not be moved to this directory, but the realms' files will reflect the use of this directory. if this option is not specified, the current directory will be used. π if-directoryand-stagediruse the same directory, then the realms environment will be build in the final directory.-nobuildβ this option tellsbuildrealmsto go through the motions of building the new realms, but not to actually build anything. if this is used in conjunctions with the-actionsoption,buildrealmswill show the actions that would have been taken. π-stagedirdirectory β this directory in which the new realms hierarchy is built. the default staging area is./staging-buildrealmsif this option is not specified. π if-directoryand-stagediruse the same directory, then the realms environment will be build in the final directory.-quietβbuildrealmsis prevented from printing any non-error output. this option and the-verboseoption are mutually exclusive. π€«-verboseβbuildrealmsprints a lot of information about what it is doing. this option and the-quietoption are mutually exclusive. π£οΈ-Versionβ displays the version number.-helpβ displays a help message. π
πΈ EXAMPLES πΈ
okay so these examples are gonna make buildrealms click for you, bestie, fr fr π in every example we're rolling with this same realms file right here:
realm "example"
state "active"
configdir "configs/example"
statedir "states/example"
realmdir "r-example"
rollrec "demo-example.rollrec"
administrator "zonefolks@example.com"
display "1"
manager "rollerd"
args "-loglevel phase -logfile log.example"
hoard "r-example"
realm "test"
state "active"
realmdir "r-test"
configdir "configs/test"
statedir "states/test"
rollrec "demo-test.rollrec"
manager "rollerd"
args "-loglevel tmi -logfile log.test"
display "1"
hoard "r-test"
π CREATE EXAMPLE π
so every realm record has a hoard field, right? and that's literally the thing buildrealms uses to find that realm's files β¨ after you run buildrealms demo.realm create with the realms file above, these directories get created:
staging-buildrealms/
staging-buildrealms/configs/
staging-buildrealms/configs/example/
staging-buildrealms/configs/example/dnssec-tools/
staging-buildrealms/configs/test/
staging-buildrealms/configs/test/dnssec-tools/
staging-buildrealms/r-example/
staging-buildrealms/r-example/dnssec-tools/
staging-buildrealms/r-test/
staging-buildrealms/r-test/dnssec-tools/
staging-buildrealms/states/
staging-buildrealms/states/example/
staging-buildrealms/states/example/key-archive/
staging-buildrealms/states/test/
staging-buildrealms/states/test/key-archive/
and these files get moved into the staging area π ngl, for the sake of brevity this is only a subset of the files moved there β most of the key files aren't even in this list:
staging-buildrealms/demo.realm
staging-buildrealms/configs/example/dnssec-tools/dnssec-tools.conf
staging-buildrealms/configs/test/dnssec-tools/dnssec-tools.conf
staging-buildrealms/r-example/demo-example.rollrec
staging-buildrealms/r-example/demo.com
staging-buildrealms/r-example/demo.com.signed
staging-buildrealms/r-example/dsset-demo.com.
staging-buildrealms/r-example/dsset-example.com.
staging-buildrealms/r-example/dsset-test.com.
staging-buildrealms/r-example/example.com
staging-buildrealms/r-example/example.com.signed
staging-buildrealms/r-example/Kdemo.com.+005+16933.key
staging-buildrealms/r-example/Kdemo.com.+005+16933.private
staging-buildrealms/r-example/test.com
staging-buildrealms/r-example/test.com.signed
staging-buildrealms/r-test/demo-test.rollrec
staging-buildrealms/r-test/dev.com
staging-buildrealms/r-test/dev.com.signed
staging-buildrealms/r-test/dsset-dev.com.
staging-buildrealms/r-test/dsset-test.com.
staging-buildrealms/r-test/Ktest.com.+005+34236.key
staging-buildrealms/r-test/Ktest.com.+005+34236.private
staging-buildrealms/r-test/test.com
staging-buildrealms/r-test/test.com.signed
π¦ TREES EXAMPLE π¦
now after you run buildrealms demo.realm trees with that same realms file above, these directories get created:
staging-buildrealms/
staging-buildrealms/configs/
staging-buildrealms/configs/example/
staging-buildrealms/configs/example/dnssec-tools/
staging-buildrealms/configs/test/
staging-buildrealms/configs/test/dnssec-tools/
staging-buildrealms/r-example/
staging-buildrealms/r-test/
staging-buildrealms/states/
staging-buildrealms/states/example/
staging-buildrealms/states/test/
and that's it β no additional files or directories are created by this command π clean, minimal, iconic.
π COPYRIGHT π
Copyright 2012-2014 SPARTA, Inc. All rights reserved.
βοΈ AUTHOR βοΈ
Wayne Morrison, tewok@tislabs.com
π SEE ALSO π
dtrealms(8),realminit(8),realmset(8)keyrec(5),realm(5),rollrec(5)
okay bestie that's the whole page, you ate that π«Ά this one's from perl v5.44.0, dated 2026-10-17, and it's BUILDREALMS(1) β go build some realms, you've got this πβ¨
π¦ where this page comes from
- arch rolling: dnssec-tools 2.2.3-16 Β· BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms