DirectSlave/GO 3 - public beta

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332

If you need to transfer all of your zones from your current machine to the servers listed in your MultiServer IP list, then you can type:

Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

which will rewrite all local zones, and thus trigger the transfer of them to the remote servers
Thanks for the answer.

The domain that I added was after configuring the multi-server setup with directslave.
Thus should this not be needed? (Please correct me if I am wrong.)

The second thing that I notice is that there are no files in /etc/named/secondary/. (Not even named.conf)
But I do have a directslave.inc with the domain name in it that I just added.

And when I run directslave --check Then I get no errors.

So it seems to be not working correctly?
Please advice.
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
only if you have other zones on the primary server

I stoped using this a while back to use PowerDNS. One day I might rewrite my script.
Thanks.

The only thing that I do not understand is why directslave does not make the zone files for the domains.
It adds the domains to the directslave.inc and links them to a .db file but the .db file is nowhere to be found.
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
in the directslave web gui you added them there?

ports 2222 and 53 all open on the directslave server?
No I added in my directadmin panel and multi-server added them to the directslave.
And yes port 2222 and port 53 are accessible on both directadmin and directslave.
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
No I added in my directadmin panel and multi-server added them to the directslave.
And yes port 2222 and port 53 are accessible on both directadmin and directslave.
And the weird thing is that the domain gets added to the directslave.inc but the .db file for that domain never gets made.
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
@cjd I have it almost working.

But do I need to make a named.conf file for bind9? or does directslave do this?
And if I need to make it myself what do I need to put in it?

Sorry if these are noob questions but I am an sysadmin for DirectAdmin and used to DirectAdmin just configuring these things.
 
Last edited:

cjd

Verified User
Joined
Feb 1, 2021
Messages
218
Location
Canada
On direct slave host:

named.conf added:

include "/etc/bind/directslave.inc";

named.conf.options:

allow-query { any; };
allow-notify { ip of DA server; };
allow-transfer { ip of DA server; };
recursion no;

On DA Host:

named.conf.options:

also-notify { ip of Directslave; };
allow-transfer { ip of Directslave; };
notify explicit;
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
On direct slave host:

named.conf added:

include "/etc/bind/directslave.inc";

named.conf.options:

allow-query { any; };
allow-notify { ip of DA server; };
allow-transfer { ip of DA server; };
recursion no;

On DA Host:

named.conf.options:

also-notify { ip of Directslave; };
allow-transfer { ip of Directslave; };
notify explicit;
Thanks,

But for whatever reason bind9 does not start when I add include "/etc/bind/directslave.inc" to /etc/bind/named.conf
The file itself exists and it has the correct permissions.

Bind9 service output:
[email protected]**myserver**:~# service bind9 status
● named.service - BIND Domain Name Server
Loaded: loaded (/lib/systemd/system/named.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-03-26 12:22:25 CDT; 1s ago
Docs: man:named(8)
Process: 12069 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 12069 (code=exited, status=1/FAILURE)
CPU: 25ms

Mar 26 12:22:25 **myserver** systemd[1]: named.service: Scheduled restart job, restart count>
Mar 26 12:22:25 **myserver** systemd[1]: Stopped BIND Domain Name Server.
Mar 26 12:22:25 **myserver** systemd[1]: named.service: Start request repeated too quickly.
Mar 26 12:22:25 **myserver** systemd[1]: named.service: Failed with result 'exit-code'.
Mar 26 12:22:25 **myserver** systemd[1]: Failed to start BIND Domain Name Server.

EDIT:

Forgot to notice/add the ; after "
Now it starts. :)
 
Last edited:

cjd

Verified User
Joined
Feb 1, 2021
Messages
218
Location
Canada
What does the log file say? It should gave some kind of reason. File should be owned root:bind, 644 permissions.

Also, if apparmor is running you will need to add:

/etc/bind/secondary/** rw,

to the /etc/apparmor.d/local/usr.sbin.named

and do a:

service apparmor reload
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
What does the log file say? It should gave some kind of reason. File should be owned root:bind, 644 permissions.

Also, if apparmor is running you will need to add:

/etc/bind/secondary/** rw,

to the /etc/apparmor.d/local/usr.sbin.named

and do a:

service apparmor reload
The only problem left is: No .db files are created in the secondary folder.
And there is nothing in the log files.

It has permission 755 and is owned by: root:bind for the secondary folder
When I run /usr/local/directslave/bin/directslave --check I get no errrors back.

The bind9 service is running and active on both directadmin and directslave server.
Any ideas?
 

cjd

Verified User
Joined
Feb 1, 2021
Messages
218
Location
Canada
If you have apparomor running you will need to do what I mentioned in my last message so bind can write to the directory.
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
If you have apparomor running you will need to do what I mentioned in my last message so bind can write to the directory.
I have done that but still no .db files. :(

EDIT:
And yes I did clearout the directslave.inc and run echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue on the directadmin server.
 

cjd

Verified User
Joined
Feb 1, 2021
Messages
218
Location
Canada
Humm have you checked the log files to see if there are any messages?

/var/log/messages
/var/log/syslog
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
Humm have you checked the log files to see if there are any messages?

/var/log/messages
/var/log/syslog
The only thing I can find that is related to named/bind is:
Mar 26 13:27:18 **myserver** kernel: [103762.802779] audit: type=1400 audit(1648319238.951:158): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="named" pid=13586 comm="apparmor_parser"
 

cjd

Verified User
Joined
Feb 1, 2021
Messages
218
Location
Canada
Just checking. If your directslave.conf you have:

named_workdir /etc/bind/secondary
named_conf /etc/bind/directslave.inc

And reading though the directslave.inc file in the bind directory you should see each line like:

zone "domain.com" { type slave; file "/etc/bind/secondary/domain.com.db"; masters { DA server IP; }; max-retry-time 1200; min-retry-time 1200; masterfile-format text; };
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
Just checking. If your directslave.conf you have:

named_workdir /etc/bind/secondary
named_conf /etc/bind/directslave.inc

And reading though the directslave.inc file in the bind directory you should see each line like:

zone "domain.com" { type slave; file "/etc/bind/secondary/domain.com.db"; masters { DA server IP; }; max-retry-time 1200; min-retry-time 1200; masterfile-format text; };
Yes, that how I have it. And all the domains are in the directslave.inc file.
I am just missing the .db files in /etc/bind/secondary folder.
 

cjd

Verified User
Joined
Feb 1, 2021
Messages
218
Location
Canada
Humm that's strange. And you did restart apparmor after making the changes? Maybe also restart bind9? Chmod secondary 775?
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
Humm that's strange. And you did restart apparmor after making the changes? Maybe also restart bind9? Chmod secondary 775?
I restarted apparmor and bind9 just to be safe and changed secondary folder to 775 but still no .db files in the secondary folder.
Even tho the domains are in the directslave.inc
 

realcryptonight

Verified User
Joined
Nov 16, 2019
Messages
332
Also when I add test.nl as a domain to DA and when its pushed to DS and then delete it again in DA I see this in the error.log
2022/03/26 15:13:21 Cant' delete zone file, /etc/bind/secondary/test.nl.db not found.

But I cannot find any error from when it should have created that file.
 
Top