Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th July 2013, 15:35
MrWolf MrWolf is offline
Member
 
Join Date: Jul 2013
Location: Quebec / Canada
Posts: 39
Thanks: 3
Thanked 9 Times in 5 Posts
Question Stop DNS replication in a ISPconfig cluster

Hi,

I used two Debian 7.1 server with ISPconfig 3.0.5.2 to create a cluster.

I used a master-to-master setup for the mysql and unison for the files.

everything is working perfetly, but I want something special for the dns.

to create a HA on it, I would like to stop the replication on the dns. This way each server will have his own DNS and the DNS will only have his own server.

When someone will access a web site, the domain will point to the DNS, and the DNS who will answer will provide his own ip adress. This way if a server failed, we will not have any timeout caused by a round robin setup.

so my question is, is there a way to be able to configure the dns from ispconfig but without any replication of the dns only?

Thank you
Reply With Quote
Sponsored Links
  #2  
Old 30th July 2013, 16:09
florian030 florian030 is offline
Senior Member
 
Join Date: Oct 2012
Posts: 276
Thanks: 8
Thanked 72 Times in 63 Posts
Default

You can modify the dns-plugin and add the server-ip to the sql-selects.
__________________
regards
Florian

blog.schaal-24.de
Reply With Quote
  #3  
Old 30th July 2013, 17:15
MrWolf MrWolf is offline
Member
 
Join Date: Jul 2013
Location: Quebec / Canada
Posts: 39
Thanks: 3
Thanked 9 Times in 5 Posts
Default

the plugin to modify seems to be:
/usr/local/ispconfig/server/plugins-enabled/bind_plugin.inc.php

but even if I add the server ip, it will be replicated to the other server. no?
Reply With Quote
  #4  
Old 30th July 2013, 18:18
florian030 florian030 is offline
Senior Member
 
Join Date: Oct 2012
Posts: 276
Thanks: 8
Thanked 72 Times in 63 Posts
Default

Youre right. You cant use something like
Code:
AND data = 'SERVER_IP'
but
Code:
SELECT * FROM dns_rr WHERE zone =8 AND active = 'Y' AND data <> 'REMOTE_IP'
should work.

In this case you should fetch the remote-ip from the database.

But you can also use a shell-script with sed to comment out the unwantend entries.
Code:
sed -i "/\(${IP_REGEX}\)/d" /var/lib/named/pri.*
Where IP_REGEX is something like "IPv4_1\|IPv4_2\|IPv6-subnet"
__________________
regards
Florian

blog.schaal-24.de
Reply With Quote
The Following User Says Thank You to florian030 For This Useful Post:
MrWolf (31st July 2013)
  #5  
Old 30th July 2013, 19:49
MrWolf MrWolf is offline
Member
 
Join Date: Jul 2013
Location: Quebec / Canada
Posts: 39
Thanks: 3
Thanked 9 Times in 5 Posts
Default

Thanks florian,
I like this idea:
Quote:
Originally Posted by florian030 View Post
Code:
SELECT * FROM dns_rr WHERE zone =8 AND active = 'Y' AND data <> 'REMOTE_IP'
should work.

In this case you should fetch the remote-ip from the database.
But this is to write the DNS file. it's an important step but how do I tell ispconfig to split the config. I don't have anything in my Server drop down list on the DNS Zone Wizard page.

I might misundertsanding something
Reply With Quote
  #6  
Old 30th July 2013, 21:39
florian030 florian030 is offline
Senior Member
 
Join Date: Oct 2012
Posts: 276
Thanks: 8
Thanked 72 Times in 63 Posts
Default

You can change
Code:
$records = $app->db->queryAllRecords("SELECT * FROM dns_rr WHERE zone = ".$zone['id']." AND active = 'Y'");
to
Code:
$records = $app->db->queryAllRecords("SELECT * FROM dns_rr WHERE zone = ".$zone['id']." AND active = 'Y' AND data <> '78.46.84.244'");
If you run server.sh on your server no dns-records with the IP 8.46.84.244 will be written.

On server A (IP 1.1.1.0) use
Code:
AND data <> '2.2.2.0'
and on server B (IP 2.2.2.0) use
Code:
AND data <> '1.1.1.0'
__________________
regards
Florian

blog.schaal-24.de
Reply With Quote
The Following User Says Thank You to florian030 For This Useful Post:
MrWolf (31st July 2013)
  #7  
Old 31st July 2013, 04:03
MrWolf MrWolf is offline
Member
 
Join Date: Jul 2013
Location: Quebec / Canada
Posts: 39
Thanks: 3
Thanked 9 Times in 5 Posts
Default

Thank you Florian,

This is a good and working solution.

this is the way I found the easier to manage in ispconfig:
create 2 "A" record with the same name, one for each server and give them the ip of each server.
then create cname for all the other name you need and point them to the "A" record you created. this way you only have to insert the ip address once.
Reply With Quote
  #8  
Old 4th August 2013, 23:34
MrWolf MrWolf is offline
Member
 
Join Date: Jul 2013
Location: Quebec / Canada
Posts: 39
Thanks: 3
Thanked 9 Times in 5 Posts
Default

Update for anyone who have a problem using own dns.

My domain name are registered at godaddy.com
So I registered my hostname like described here: http://support.godaddy.com/help/arti...meservershosts

then, I changed my ns on godaddy for my own ns and my dns stop working.
I couldn't resolv my domain anymore.

in the bind folder, I had pri.domain.com.err instead of pri.domain.com
to solve this problem I had to modify the MySQL query to this:
$records = $app->db->queryAllRecords("SELECT * FROM dns_rr WHERE zone = ".$zone['id']." AND active = 'Y' AND (data <> 'REMOTE IP' OR name = 'ns1.domain.com.' OR name = 'ns2.domain.com.')");

*domain.com would be my main domain

this way, I create 2 "A" record with ns1 and ns2 and I use ns1 and ns2 as nameserver

as soon as I did that, the .err from my pri.domain.com disappear and my dns start working.

if anyone need more detail of what I did, just reply to this post
Reply With Quote
  #9  
Old 6th August 2013, 17:56
florian030 florian030 is offline
Senior Member
 
Join Date: Oct 2012
Posts: 276
Thanks: 8
Thanked 72 Times in 63 Posts
Default

I just changed the request to
Code:
SELECT * FROM dns_rr WHERE zone=".$zone['id']." AND active = 'Y' AND (data NOT IN (SELECT ip_address FROM server_ip WHERE server_ip.server_id<>".$conf["server_id"].") OR name REGEXP '^ns')
I`ve the same code on each server und the sub-select filters out all remote-ips, a long as they are not defined as ns*
__________________
regards
Florian

blog.schaal-24.de
Reply With Quote
The Following User Says Thank You to florian030 For This Useful Post:
MrWolf (6th August 2013)
  #10  
Old 6th August 2013, 20:21
MrWolf MrWolf is offline
Member
 
Join Date: Jul 2013
Location: Quebec / Canada
Posts: 39
Thanks: 3
Thanked 9 Times in 5 Posts
 
Default

Thank you for this fine-tuning,

I'll change my settings also
Reply With Quote
Reply

Bookmarks

Tags
cluster, dns, replication

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
around 80 sleeping connections created by ISPConfig bkilinc General 2 1st October 2012 17:12
No dns zone files created? sjau Installation/Configuration 7 13th March 2012 14:15
All files gone after changing quota to 0 spynode General 17 19th January 2012 15:41
Unable send receive emails vassilis3 Installation/Configuration 15 19th May 2007 15:34
FC4 Setup DNS and ISPCONFIG issues The General Installation/Configuration 7 15th May 2006 10:45


All times are GMT +2. The time now is 01:35.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.