MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: rsakhale on 2017-05-02, 09:05:15

Title: Setting up multiple DNS server
Post by: rsakhale on 2017-05-02, 09:05:15
Dear Mustafa,

Could you please help understand or redirect to proper documentation that helps understand how can we achieve multiple DNS server.

Also, will Master/Slave functionality help achieve multiple DNS servers?

Regards
Rohan
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-02, 09:25:17
Let say you have server1 (IP 111.111.111.111) and server2 (IP 222.222.222.222) and domain.com.

In server1, set dns as:
Code: [Select]
ns1 IN A 111.111.111.111
ns2 IN A 222.222.222.222
__base__ IN NS ns1.domain.com.
__base__ IN NS ns2.domain.com.

and then in server2, go to 'admin > secondary dns' and add 'Primary IP' as '111.111.111.111' and 'Domain' ad 'domain.com'.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-02, 23:25:05
Problem is, the ns2.domain.com will be useless for all the zone records you add to server1.
We need a way to sync the zone records from server1 to server2. I'm using simple rsync for that.

@mustafa, again, we need a wiki for this. If you are not interested or see how useful a wiki is, i'll create one to help users + to have it as a documentation for myself :  ;))
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-03, 06:42:06
No, if you set ns2 to IP from other server, dns server in Kloxo-MR will be notify to this other server (after you add domain via 'secondary dns' in other server).

Remember, only bind, nsd and pdns can handle 'dns clustering'.

In your situation, try 'sh /script/restart-dns' in server1 dan then the same way in server2.
Title: Re: Setting up multiple DNS server
Post by: rsakhale on 2017-05-03, 07:17:06
@mustafa, again, we need a wiki for this. If you are not interested or see how useful a wiki is, i'll create one to help users + to have it as a documentation for myself :  ;))
Even I am interested in documenting for Kloxo-MR, had already began it for myself available at https://notes.saiashirwad.org/Kloxo-MR/
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-03, 10:19:48
Oh so Kloxo-MR actually supports  DNS slaves in the right way. I wasn't aware of that.

Does it mean we can add more slaves by adding Kloxo-MR servers and using "secondary dns"?



No, if you set ns2 to IP from other server, dns server in Kloxo-MR will be notify to this other server (after you add domain via 'secondary dns' in other server).

Remember, only bind, nsd and pdns can handle 'dns clustering'.

In your situation, try 'sh /script/restart-dns' in server1 dan then the same way in server2.
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-03, 10:28:29
Idea for 'secondary dns' is make possible Kloxo-MR 7.0 as 'secondary dns' from 'primary dns'. You can use other panel (like CPanel) as 'primary dns'.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-03, 11:27:53
Ah ok. Then it means, as far as i understand based on what you write @mustafa and without any testing so far, the "secondary dns" is a straight DNS slave getting zone files from the master via inotify.
"secondary dns" is quite confusing here!

I think you can consider changing ""secondary dns"  to something like "DNS slave" if it doesn't break anything @mustafa. IMO, such is important to promote Kloxo-MR so that users/reviewers/future potential users dont' get confused and actually see that Kloxo-MR supports DNS slaves :) This a big feature IMO!  8)


Yes, i'm aware i can simply use other DNS server to rsync the zone files and make them master DNS servers.

But my question is, if i install 2 more Kloxo-MR instances, they can all act like slaves (secondary dns) right?
Given i configure master with ns2, ns3 etc with correct IPs ofc :)
 




Idea for 'secondary dns' is make possible Kloxo-MR 7.0 as 'secondary dns' from 'primary dns'. You can use other panel (like CPanel) as 'primary dns'.
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-03, 13:05:49
Previous Bind using primary/secondary term and then change to master/slave.

But, many providers still using primary/secondary term. I follow it.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 10:00:38
@mustafa,
i just changed my server1 and server2 with such a setup, and i can see the notify in the logs of both servers.
But where are slave saving the config files as i don't see any?



On slave, the file is empty:
[root@kloxomrc7_01 bind]# cat conf/defaults/named.slave.conf
[root@kloxomrc7_01 bind]#


Also, before this change, i had rsynced all the Bind and Nsd config from master to "slave" to have "slave" serve all the zones as master.
So right now, the DNS sec keys are the same on slave. Should i delete the config files of Bind and Nsd and reinstall Bind and nsd?




[root@kloxomrc7_01 bind]# ll /opt/configs/nsd/conf/slave/
total 0
[root@kloxomrc7_01 bind]#



Let say you have server1 (IP 111.111.111.111) and server2 (IP 222.222.222.222) and domain.com.

In server1, set dns as:
Code: [Select]
ns1 IN A 111.111.111.111
ns2 IN A 222.222.222.222
__base__ IN NS ns1.domain.com.
__base__ IN NS ns2.domain.com.

and then in server2, go to 'admin > secondary dns' and add 'Primary IP' as '111.111.111.111' and 'Domain' ad 'domain.com'.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 11:16:51
At the slave i see:
received notify for zone 'sub.domain.com': not authoritative
It's probably due to lack of the slave zone file which is lacking from /opt/configs/bind/conf/defaults/named.slave.conf.
There is nothing there now.

How does Kloxo-MR handle notify messages coming from master to slave?
I see the code here: cat /opt/configs/bind/tpl/list.slave.conf.tpl, but when is this triggered?
Also as i said, there is NOTHING in /opt/configs/nsd/conf/slave. Should the slave zones be automatically created after notification from master?

Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-05, 13:06:24
Make sure IP from 'secondary dns' server list in 'A record' for ns.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 13:38:18
I have :
    __base__    NS    -    ns2.domain.com
    ns2    A    -    222.222.222.222


That should be enough i guess?   


Make sure IP from 'secondary dns' server list in 'A record' for ns.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 16:52:28
@mustafa, should i go back to using DNS master on server2 with rsync (from server1) as i had before?


Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-05, 17:05:48
@mustafa, should i go back to using DNS master on server2 with rsync (from server1) as i had before?
Request from server2 only work after dns full propagation. But, you can try 'sh /script/restart-dns' in server2 (make sure domain alteady listed in list.slave.conf)
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 17:16:11
Yes, i understand that, but it seems it receives all the zones. But it seems they are not saved at server2.
I think it should be saved at /opt/configs/nsd/conf/slave, but i'm not sure.

So Kloxo-MR  at server2 is supposed to create the zone defintions in /opt/configs/bind/conf/defaults/named.slave.conf?

I tried restart-dns, there is no difference since there is NO zone files at server2.
What do you mean by "make sure domain alteady listed in list.slave.conf"?
You probably mean listed in /opt/configs/bind/conf/defaults/named.slave.conf?

Do we need to do something manually first to get this working?



@mustafa, should i go back to using DNS master on server2 with rsync (from server1) as i had before?
Request from server2 only work after dns full propagation. But, you can try 'sh /script/restart-dns' in server2 (make sure domain alteady listed in list.slave.conf)
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-05, 17:29:53
So Kloxo-MR  at server2 is supposed to create the zone defintions in /opt/configs/bind/conf/defaults/named.slave.conf?
Yes.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 17:36:51
Alright. Is the creation of slave zones triggered by zones transfers from master?
I.e when the DNS master transfers zones to slave/server2, Kloxo-MR understands it and runs /opt/configs/bind/tpl/list.slave.conf.tpl?

I don't  understand why this shouldn't work. I suspect it's Kloxo-MR not working as it should. Bind seems to do it's work both master and slave, but Kloxo-MR obviously is not creating the slave zone files!



So Kloxo-MR  at server2 is supposed to create the zone defintions in /opt/configs/bind/conf/defaults/named.slave.conf?
Yes.
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-05, 17:54:05
Make sure add domain 'secondary dns' from client where locate to server2.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 18:10:13
Sorry, i didn't understand this  :-\

Make sure add domain 'secondary dns' from client where locate to server2.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-05, 19:37:52
Have you got "secondary dns" to work as slave DNS server with Kloxo-MR?
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-06, 06:00:15
'Secondary DNS' available for all client. So, if we want domain in master also have 'secondary dns', select one of client where in slave server and click 'secondary dns'.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-06, 08:24:43
I see. But when you have 2 servers, say server1 (main Kloxo-MR server and DNS master) and server2 (Kloxo-MR server, but added to server1 in "Servers"), all clients are created ONLY at server1, but we can choose to have web, MySQL, mail and DNS at server2. 
Now i add a client in server1 with web, MySQL and mail choosen at server2, but DNS will be local (server1).
When clients are added this way, they are NOT visible under clients in server2.
So i wonder how we can deal with "Secondary DNS" for this client in server2?




 

 




'Secondary DNS' available for all client. So, if we want domain in master also have 'secondary dns', select one of client where in slave server and click 'secondary dns'.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-07, 12:07:32
@mustafa, now i also tried to use the "DNS Servers" Under Servers for a client, by adding localhost and server2 (IP addr) as the DNS servers.
In the DNS template in server1, i have A record for ns1 and  server1 IP and another A record for  ns2  and server2 IP.

When i create a client using this setup, Kloxo-MR is behaving totally strange when it comes to handling DNS servers. First, when a domain in creating under this client, it's DNS record is only created in server2.  Then when i create a subdomain, it gets added to server1 and server2. So now, server1 ONLY has DNS records for this sub domain, while server2 has for both main domain and subdomain! Very strange.
I want to have all on both servers.

And when i delete the domain, the DNS records in server2 is NOT DELETED, only in server1. What a TOTAL MESS this is.

Do you have any plans to fix this @mustafa, please? DNS is so critical when dealing with a control panel IMO.

I'm willing to contribute and donate to solving this issue and to create a fully working DNS master -master or master-slave setup.









Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-07, 12:49:46
I am not testing 'secondary dns' on master-slave but master-master. I am not sure what's happen for master-slave for 'secondary dns'.
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-07, 13:10:30
Ok. Now i went back to using server2 as DNS master with rsync of zone files from server1.
It works ok for now.




I am not testing 'secondary dns' on master-slave but master-master. I am not sure what's happen for master-slave for 'secondary dns'.
Title: Re: Setting up multiple DNS server
Post by: MRatWork on 2017-05-08, 05:06:48
I will try change 'secondary dns' based on server (it's make possible change target server).
Title: Re: Setting up multiple DNS server
Post by: fossxplorer on 2017-05-08, 10:47:25
Yeah, a master Kloxo-MR server with master DNS zones should not have "secondary DNS" right?
Anyway i'm very much interested to help you test/support/discuss to get this supported :)

I will try change 'secondary dns' based on server (it's make possible change target server).