nsd-control(8)
โจ NAME โจ
Okay bestie, this is the nsd-control(8) manual page from the nsd 4.15.4 era, and the names on the cover are nsd-control and nsd-control-setup โ together they're the NSD remote server control utility. ๐ซถ
๐ธ SYNOPSIS ๐ธ
nsd-control [-c cfgfile] [-s server] command
๐ DESCRIPTION ๐
nsd-control does remote administration on the nsd(8) DNS server. It reads the config file, contacts the nsd server over SSL, sends the command, and shows you the result. Commands that require a reload are queued, and the result indicates the command was accepted. No cap. ๐
The available options are, bestie:
-hโ Show the version and commandline option help. ๐ซถ-ccfgfileโ The config file to read with settings. If not given, the default config file/etc/nsd/nsd.confis used. ๐๏ธ-sserver[@port]โ IPv4 or IPv6 address of the server to contact. If not given, the address is read from the config file. ๐
๐ COMMANDS ๐
There are several commands that the server understands. Vibe check: here they are, in order, with all the deets. ๐ง
startโ Start the server. Simply execsnsd(8). Thensdexecutable is not searched for in thePATHset in the environment. Instead, it uses the default location relative to the installation prefix specified at compile-time. The executable location can be overridden by settingNSD_PATHin the environment. It is started with the config file specified using-cor the default config file. ๐stopโ Stop the server. The server daemon exits. ๐reload [<zone>]โ Reload zonefiles and reopen logfile. Without argument, reads changed zonefiles. With argument, reads the zonefile for the given zone and loads it. ๐reconfigโ Reloadnsd.confand apply changes to TSIG keys and configuration patterns, and apply the changes to add and remove zones that are mentioned in the config. Other changes are not applied, such as listening ip address and port and chroot, also per-zone statistics are not applied. The pattern updates means that the configuration options for zones (request-xfr,zonefile,notify, ...) are updated. Also new patterns are available for use with theaddzonecommand. ๐งrepatternโ Same as thereconfigoption. โจlog_reopenโ Reopen the logfile, for log rotate that wants to move the logfile away and create a new logfile. The log can also be reopened withkill -HUP(which also reloads all zonefiles). ๐statusโ Display server status. Exit code3if not running (the connection to the port is refused),1on error,0if running. ๐ฆstatsโ Output a sequence ofname=valuelines with statistics information, requires NSD to be compiled with this option enabled. ๐stats_noresetโ Same asstats, but does not zero the counters. ๐งฎaddzone <zone name> <pattern name>โ Add a new zone to the running server. The zone is added to the zonelist file on disk, so it stays after a restart. The pattern name determines the options for the new zone. For secondary zones a zone transfer is immediately attempted. For zones with a zonefile, the zone file is attempted to be read in. โdelzone <zone name>โ Remove the zone from the running server. The zone is removed from the zonelist file on disk, from thensd.dbfile and from the memory. If it had a zonefile, this remains (but may be outdated). Zones configured insidensd.confitself cannot be removed this way because the daemon does not write to thensd.conffile, you need to add such zones to the zonelist file to be able to delete them with thedelzonecommand. ๐๏ธchangezone <zone name> <pattern name>โ Change a zone to use the pattern for options. The zone is deleted and added in one operation, changing it to use the new pattern for the zone options. Zones configured innsd.confcannot be changed like this, instead edit thensd.conf(or the included file innsd.conf) andreconfig. ๐addzonesโ Add zones read from stdin ofnsd-control. Input is read per line, withname space patternnameon a line. For bulk additions. ๐ฅdelzonesโ Remove zones read from stdin ofnsd-control. Input is one name per line. For bulk removals. ๐คwrite [<zone>]โ Write zonefiles to disk, or the given zonefile to disk. Zones that have changed (viaAXFRorIXFR) are written, or if the zonefile has not been created yet then it is created. Directory components of the zonefile path are created if necessary. With argument that zone is written if it was modified, without argument, all modified zones are written. ๐notify [<zone>]โ SendNOTIFYmessages to secondary servers. Sends to the IP addresses configured in the'notify:'lists for the primary zones hosted on this server. Usually NSD sendsNOTIFYmessages right away when a primary zone serial is updated. If a zone is given, notifies are sent for that zone. These secondary servers are supposed to initiate a zone transfer request later (to this server or another primary), this can be allowed via the'provide-xfr:'acl list configuration. With argument that zone is processed, without argument, all zones are processed. ๐ฃtransfer [<zone>]โ Attempt to update secondary zones that are hosted on this server by contacting the primaries. The primaries are configured via'request-xfr:'lists. If a zone is given, that zone is updated. Usually NSD receives aNOTIFYfrom the primaries (configured via'allow-notify:'acl list) that a new zone serial has to be transferred. For zones with no content, NSD may have backed off from asking often because the primaries did not respond, but this command will reset the backoff to its initial timeout, for frequent retries. With argument that zone is transferred, without argument, all zones are transferred. ๐force_transfer [<zone>]โ Force update secondary zones that are hosted on this server. Even if the primary hosts the same serial number of the zone, a fullAXFRis performed to fetch it. If you want to useIXFRand check that the serial number increases, use thetransfercommand. With argument that zone is transferred, without argument, all zones are transferred. ๐ฅzonestatus [<zone>]โ Print state of the zone, the serial numbers and since when they have been acquired. Also prints the notify action (to which server), and zone transfer (and from which primary) if there is activity right now. The state of the zone is printed as:'primary'(primary zones),'ok'(secondary zone is up-to-date),'expired'(secondary zone has expired),'refreshing'(secondary zone has transfers active). The serial numbers printed are the'served-serial'(currently active), the'commit-serial'(is in reload), the'notified-serial'(got notify, busy fetching the data). The serial numbers are only printed if such a serial number is available. With argument that zone is printed, without argument, all zones are printed. ๐ต๏ธserverpidโ Prints the PID of the server process. This is used for statistics (and only works when NSD is compiled with statistics enabled). This pid is not for sending unix signals, use the pid fromnsd.pidfor that, that pid is also stable. ๐verbosity <number>โ Change logging verbosity. ๐print_tsig [<key_name>]โ print the secret and algorithm for the TSIG key with that name. Or list all the tsig keys with their name, secret and algorithm. ๐update_tsig <name> <secret>โ Change existing TSIG key with name to the new secret. The secret is a base64 encoded string. The changes are only in-memory and are gone next restart, for lasting changes edit thensd.conffile or a file included from it. ๐งadd_tsig <name> <secret> [algo]โ Add a new TSIG key with the given name, secret and algorithm. Without algorithm a default (hmac-sha256) algorithm is used. The secret is a base64 encoded string. The changes are only in-memory and are gone next restart, for lasting changes edit thensd.conffile or a file included from it. ๐assoc_tsig <zone> <key_name>โ Associate the zone with the given tsig. The access control lists for notify, allow-notify, provide-xfr and request-xfr are adjusted to use the given key. ๐del_tsig <key_name>โ Delete the TSIG key with the given name. Prints error if the key is still in use by some zone. The changes are only in-memory and are gone next restart, for lasting changes edit thensd.conffile or a file included from it. โadd_cookie_secret <secret>โ Add or replace a cookie secret persistently.<secret>needs to be an128bit hex string. ๐ช
Cookie secrets can be either active or staging. Active cookie secrets are used to create DNS Cookies, but verification of a DNS Cookie succeeds with any of the active or staging cookie secrets. The state of the current cookie secrets can be printed with the print_cookie_secrets command.
When there are no cookie secrets configured yet, the <secret> is added as active. If there is already an active cookie secret, the <secret> is added as staging or replacing an existing staging secret.
To "roll" a cookie secret used in an anycast set. The new secret has to be added as staging secret to all nodes in the anycast set. When all nodes can verify DNS Cookies with the new secret, the new secret can be activated with the activate_cookie_secret command. After all nodes have the new secret active for at least one hour, the previous secret can be dropped with the drop_cookie_secret command.
Persistence is accomplished by writing to a file. That file is configured with the cookie-secret-file option in the server section of the config file. The default value for that is: /var/db/nsd/cookiesecrets.txt .
drop_cookie_secretโ Drop the staging cookie secret. ๐ชactivate_cookie_secretโ Make the current staging cookie secret active, and the current active cookie secret staging. โprint_cookie_secretsโ Show the current configured cookie secrets with their status. ๐จ๏ธ
๐ช EXIT CODE ๐ช
The nsd-control program exits with status code 1 on error, 0 on success. Periodt. ๐ฌ
๐ ๏ธ SET UP ๐ ๏ธ
okay bestie, before you can even talk to nsd-control, you gotta do the lil handshake setup, and it's giving very much "trust nobody, verify everybody" ๐
The setup needs a self-signed certificate and private keys, for both the server and the client. Yes, both. Two sides, two sets of keys, no shortcuts.
The script nsd-control-setup generates these for you in the default run directory โ or, if you're feeling fancy and want them literally anywhere else, hit it with -d and point it at another directory. Periodt.
Here's the tea on permissions ๐ซ โ the key files have access control permissions, and those permissions are what decide who gets to use nsd-control. Default is owner and group, but not all users. So if you loosen (or tighten) those perms, you're literally deciding who holds the keys to the kingdom. Choose wisely, queen ๐.
Also like, super important: the script preserves private keys present in the directory. It does not yeet your existing keys, it keeps them. Iconic behaviour honestly.
And the very last step, don't forget it or the whole thing is a flop: after running the script as root, turn on control-enable in nsd.conf. That's the switch. Flip it. โจ
๐ STATISTIC COUNTERS ๐
so the stats command spills a whole bunch of statistic counters at you, and here's the full rundown of every single one, no cap:
num.queriesโ number of queries received (the tls, tcp and udp queries added up).serverX.queriesโ number of queries handled by the server process. The number of server processes is set with the config statementserver-count.time.bootโ uptime in seconds since the server was started. With fractional seconds.time.elapsedโ time since the last stats report, in seconds. With fractional seconds. Can be zero if polled quickly and the previousstatscommand resets the counters, so that the next gets a fully zero, and zero elapsed time, report. (yeah, that's a real quirk, don't @ me ๐ญ)size.db.diskโ size ofnsd.dbon disk, in bytes.size.db.memโ size of the DNS database in memory, in bytes.size.xfrd.memโ size of memory for zone transfers and notifies in xfrd process, excludes TSIG data, in bytes.size.config.diskโ size of zonelist file on disk, excludes thensd.confsize, in bytes.size.config.memโ size of config data in memory, kept twice in server and xfrd process, in bytes.num.type.Xโ number of queries with this query type.num.opcode.Xโ number of queries with this opcode.num.class.Xโ number of queries with this query class.num.rcode.Xโ number of answers that carried this return code.num.ednsโ number of queries with EDNS OPT.num.ednserrโ number of queries which failed EDNS parse.num.udpโ number of queries over UDP ip4.num.udp6โ number of queries over UDP ip6.num.tcpโ number of connections over TCP ip4.num.tcp6โ number of connections over TCP ip6.num.tlsโ number of connections over TLS ip4. TLS queries are not part ofnum.tcp. (they're separate bestie, stay in your lane ๐)num.tls6โ number of connections over TLS ip6. TLS queries are not part ofnum.tcp6.num.answer_wo_aaโ number of answers with NOERROR rcode and without AA flag, this includes the referrals.num.rxerrโ number of queries for which the receive failed.num.txerrโ number of answers for which the transmit failed.num.raxfrโ number of AXFR requests from clients (that got served with reply).num.rixfrโ number of IXFR requests from clients (that got served with reply).num.truncatedโ number of answers with TC flag set.num.droppedโ number of queries that were dropped because they failed sanity check. ๐zone.primaryโ number of primary zones served. These are zones with no'request-xfr:'entries. Also output as'zone.master'for backwards compatibility.zone.secondaryโ number of secondary zones served. These are zones with'request-xfr'entries. Also output as'zone.slave'for backwards compatibility.
ngl thezone.primary/zone.masterandzone.secondary/zone.slavedouble-output thing is literally just the old names hanging around for backwards compatibility. Both show up. That's it, that's the vibe ๐
๐ FILES ๐
/etc/nsd/nsd.confโ nsd configuration file. the main character tbh ๐/etc/nsdโ directory with private keys (nsd_server.keyandnsd_control.key) and self-signed certificates (nsd_server.pemandnsd_control.pem). keep this locked down bestie ๐
๐ SEE ALSO ๐
go read these too, iykyk ๐ฆ
and that's the whole page, you're officially certified ๐โจ brought to you by NLnet Labs, dated okt 21, 2026, and filed under nsd-control(8) โ go forth and control your nsd, bestie, you got this ๐๐ธ๐ซถ
๐ฆ where this page comes from
- epel 10: nsd 4.15.4-1.el10_3 ยท BSD-3-Clause
- epel 9: nsd 4.15.4-1.el9 ยท BSD-3-Clause
- Copyright (c) 2011-2024, NLnet Labs. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms