DirectSlave 4: secondary DNS for DirectAdmin with integrated DNS server, DNSSEC and IPv6 (open source)

"Domain 'domeinnaam.nl' reload forbidden for 'IP-of-Old-VPS'"
Hmmz... I'm not sure. Reload forbidden might have to do with the ip present in the /etc/named.conf of the DS server. But that should all be fine as you didn't change anything of named itself on the DA or DS server.

Now it could be caused because of previous issues indeed, so it's important to see which nameserver has the old ip. Is it in the /var/named/domeinnaam.nl.db on the DA server or in the /etc/named/secondary/domeinnaam.nl.db (if you kept the default structure) on the DS server?
If it's only on the DS server, then in theory a new sending of the named from the DA server should do the trick.

Execute this command on the DA server:
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
which will take 1 minute to start anyway.

Wait until the task.queue in the /usr/local/directadmin/data is finished (gone) and keep an eye on the DS error log.
It could take a few minutes after transfer is complete, but then the domeinnaam.nl.db with correct ip address should be present on the DS server.
 
  • Like
Reactions: BBM
@roman_m
I've seen this now twice on different cloud VPS systems, but both with Hetzner in this case.
Code:
directslave: cannot execute binary file: Exec format error
This is an error returned at Alma 9 VPS systems with Hetzner. I first thought it was the VPS so we switched to Contabo on Alma 8 and fine.

So I did some further investigation now and probably found the cause.

Same for uname, gives both "Linux".
On the Almalinux 9 VPS systems (at least Hetzner VPS), an uname -a gives this:
Linux 5.14.0-570.41.1.el9_6.aarch64 #1 SMP PREEMPT_DYNAMIC Thu Sep 11 06:30:10 CDT 2025 aarch64 aarch64 aarch64 GNU/Linux
So this is an aarch64 architecture and there is no binary for that.

I don't know if you can create a aarch64 binary addittionally if you have time, maybe after the war.

For everybody reading this, if you want a Cloud VPS with Directslave, be sure you get either x84-64 architecture or choose the ARM64 architecture because there is an arm64 binary for Directslave.
 
For everybody reading this, if you want a Cloud VPS with Directslave, be sure you get either x84-64 architecture or choose the ARM64 architecture because there is an arm64 binary for Directslave.
I have a load of Hetzner servers, and I tried Directadmin with an ARM VPS the other week to see what the support was like and it runs very well. The ARM servers have twice the cores and RAM as their x86 counterparts and are very responsive. The only thing I found was some software providers like Softaculous don't support ARM yet and as such don't include ARM compiled ioncube loaders with their products. In short if you use Softaculous products like Backuply (for example) it won't work as there's no support.
 
Yep I just encountered this with Directslave, but they also have Intel architecture, only with half the ram (at this moment) than with the arm64.
So for DS one can also choose for the Intel.

It's just for letting people know they have to watch if they order Cloud VPS, that they watch what they choose. And indeed as you say also for Softaculous and backuply if they want to run that on it.
 
Hi all!

DirectSlave 4 is released, and it is open source now.

What I was cooking is ready: DirectSlave 4, featuring an integrated secondary authoritative DNS server with DNSSEC and NSEC3 support, plus an extended dashboard and detailed statistics.

You no longer need BIND on the secondary. One static binary takes the Multi-Server API calls from DirectAdmin, transfers the zones from the primary and answers the DNS queries itself.

Source code, BSD 3-Clause license -- https://github.com/directslave/directslave

Downloads, version 4.0.18:

FreeBSD amd64 -- https://github.com/directslave/directslave/releases/tag/v4.0.18-freebsd
Linux amd64 -- https://github.com/directslave/directslave/releases/tag/v4.0.18-linux

View attachment 9910

View attachment 9911

What is new:
+ integrated authoritative secondary DNS: UDP and TCP, IPv4 and IPv6, AXFR, NOTIFY, SOA refresh/retry/expire timers
+ DNSSEC for signed zones, NSEC and NSEC3. DirectSlave does not sign anything, it serves exactly what your primary signed
+ startup check: after a restart every zone is compared with its primary by serial before it is answered
+ new dashboard: state, serial, records, DNSSEC, last transfer, next refresh, expiry and last error for every zone, with filters and sorting
+ statistics page with a breakdown per primary
+ zone management from the shell: --domain search / add / delete / reload, and --dump-db to look inside the running daemon
+ IDN zones in both Unicode and punycode form
+ optional query log (off / errors / all)
+ IPv6 everywhere: API, dashboard, zone transfers, NOTIFY, IPv6 primaries
+ --password asks for the password instead of taking it on the command line, so it no longer ends up in the shell history
+ Linux: systemd unit, AppArmor profile and SELinux policy included. FreeBSD: rc.d script

Upgrading from 3.x:
Your current directslave.conf works as it is. Without the new options version 4 behaves like 3.5 and keeps driving BIND through rndc, so you can replace the binary and the www folder first and switch later.

To switch to the integrated DNS server, stop BIND on the secondary and add to directslave.conf:

Code:
dns_server      integrated
dns_listen_ip4  *
dns_listen_ip6  *
dns_port        53

The zone list file (named_conf) stays the same, so the zones you already have are picked up and transferred.

Limitations:
- secondary only, it never acts as a primary and never signs zones
- zones are transferred with AXFR, no IXFR and no TSIG
- release binaries are amd64 only, for other platforms build from source

The integrated server has been running in my own production for over a month, close to 10,000 zones, and not a single zone was lost. Still, it is a .0 release of a DNS server: try it on one secondary first.

Do not forget to read INSTALL inside the archive. Full documentation -- https://github.com/directslave/directslave/tree/main/docs

Bug reports and questions are welcome here in the thread or in GitHub issues. Pull requests too ;-)
 
I've used the upgrade instructions here:
[unfurl]https://github.com/directslave/directslave/blob/main/docs/upgrading.md[/unfurl]

So it should still work the old way with rndc and bind correct?

However, directslave does not start.

Code:
service directslave status:
Nov 18 19:44:21 vps.example.com systemd[1]: directslave.service: Service RestartSec=100ms expired, scheduling restart.
Nov 18 19:44:21 vps.example.com systemd[1]: directslave.service: Scheduled restart job, restart counter is at 5.
Nov 18 19:44:21 vps.example.com systemd[1]: Stopped DirectSlave for DirectAdmin.
Nov 18 19:44:21 vps.example.com systemd[1]: directslave.service: Start request repeated too quickly.
Nov 18 19:44:21 vps.example.com systemd[1]: directslave.service: Failed with result 'exit-code'.
Nov 18 19:44:21 vps.example.com systemd[1]: Failed to start DirectSlave for DirectAdmin.

Nothing in the error log after the shutdown before making the changes.
Even waited 10 minutes, tried again, still the same.

Any clue?

Edit: when running manually with the --debug commandline it runs fine.
So it seems an issue with it trying to run from systemd??
 
Last edited:
I might have found the culprit, though still odd.
Code:
directslave[1860964]: Couldn't create pid file: open /usr/local/directslave/run/directslave.pid: permission denied
Which is odd because named is owner of that directory and has writing permissions. Even stranger at 20.00 after conversion in fact a directslave.pid file was written.

Probably the pid file was not deleted when stopping the old directslave or something went wrong with it. Seems to run fine now.

Code:
[Unit]
Description=DirectSlave for DirectAdmin
After=network.target
[Service]
Type=simple
User=named
ExecStart=/usr/local/directslave/bin/directslave --run
Restart=always
[Install]
WantedBy=multi-user.target

I presume I have to replace this when using the new method with the build in bind? Because I've looked at it and the new one had more content.
 
Good catch, and you found the right thing. In BIND mode 4.x drops to the named user first and writes the pid file after that. Owning the directory
is not enough to overwrite a file that belongs to someone else, and the old directslave.pid was root's: 3.5 wrote it as root. Once it was gone,
everything worked.

The next release replaces such a file by itself.

Why systemd gave up: your unit restarts after 100 ms, so five failures came within half a second and systemd stopped trying ("Start request repeated too quickly"). After that even a fixed problem needs:

systemctl reset-failed directslave

before it starts again. RestartSec=5s avoids that.

And if you run it in external DNS mode, please keep your old unit file. The new one is meant for the integrated DNS server and stops named when
DirectSlave starts.
 
The new one is meant for the integrated DNS server and stops named when
DirectSlave starts.
Yep thank you. I will keep that until I go over completely.

Just a question for the last conversion later on to make things easier.
When changing to the internal DNS, is it a good idea to replace all files with the new ones, except the directslave.conf ofcourse (need to edit that manually)?

This way also the directslave-prepare and maybe other new files will be present which might be missing if only changing the directslave.conf without copying all files.
 
To switch to the integrated DNS server, unpack the release archive and take the new files from it:

mkdir /tmp/ds4 && tar -xzf directslave-4.0.18-linux-amd64.tar.gz -C /tmp/ds4
cp /tmp/ds4/directslave/etc/systemd/directslave.service /etc/systemd/system/directslave.service
cp /tmp/ds4/directslave/bin/directslave-prepare /usr/local/directslave/bin/
cp -R /tmp/ds4/directslave/www/. /usr/local/directslave/www/
systemctl daemon-reload

Then edit your directslave.conf as described in
(dns_server integrated, dns_listen_ip4, dns_listen_ip6, dns_port).

Stop BIND for good, so DirectSlave can take port 53, and check the config:

systemctl stop directslave
systemctl disable --now named
/usr/local/directslave/bin/directslave --check

If --check ends with "All OK", start it:

systemctl reset-failed directslave
systemctl start directslave

The first start checks every zone against its primary, so it takes a while with many zones. Watch it with:

tail -f /usr/local/directslave/log/dns.log

For the other options, see https://github.com/directslave/directslave/blob/main/docs/configuration.md
 
Thanks. Why not remove or overwrite the old files except directslave.conf? Is that in case one has to put everything back to version 3?
Because that would be a lot easier/quicker.
 
Back
Top