Current time: 11-15-2024, 07:25 PM Hello There, Guest! (LoginRegister)


Post Reply 
how to setup nameservers
Author Message
zx-75 Offline


Posts: 1
Joined: Oct 2011
Reputation: 0
Post: #1
how to setup nameservers
hello

i installed on my vps ispCP 1.0.7 OMEGA build: 20101124 with os Debian 5.0 (Lenny)

i want to setup nameservers in ispcp like

ns1.domain.com
ns2.domain.com

for all my clients on vps so that they can change ns on their domains any help? thankyou.
(This post was last modified: 10-08-2011 09:00 PM by zx-75.)
10-08-2011 08:57 PM
Find all posts by this user Quote this message in a reply
Boss Online Offline
Junior Member
*

Posts: 11
Joined: Nov 2009
Reputation: 0
Post: #2
RE: how to setup nameservers
i`m intersted too please help me.

need ns1 and ns2.
02-29-2012 06:34 AM
Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #3
RE: how to setup nameservers
you need a 2nd server and then :

you create a folder below your admin domain i.e. ( admin.yourdomain.com/tools/dns-export.php )
then you create a script which exports a named.conf.local so your slave dns server knows about the domains it needs to get....

Code:
<?
$link = mysql_connect("localhost", "pdns_sql", "your db pw")
    or die("No connection possible: " . mysql_error());
mysql_select_db("ispcp") or die("Database selection impossible!");

/* execute SQL query for domains */
$query = "SELECT domain_name as name FROM domain union select alias_name as name from domain_aliasses ";
$query = "union select (select concat(a.subdomain_name,'.',b.domain_name) from subdomain a left join domain as b on a.domain_id=b.domain_id) as name";$query = "union select (select concat(a.subdomain_alias_name,'.',b.alias_name) from subdomain_alias a left join domain_aliasses b on a.alias_id=b.alias_id) as name ";
$result = mysql_query($query) or die("Queery failed: " . mysql_error());


$zonefile = "# autogenerated Zonefile do not edit !\r\n";
$zonefile .= "include \"/etc/bind/zones.rfc1918\";\r\n";

$master = "<IP of your dns master>";
$zonefiledir = "/var/cache/bind";

while ($daten = mysql_fetch_array($result)) {
$zone = $daten['name'];
if ( $zone !="NULL" ) { 
        $zonefile .= "zone \"$zone\" {   \n
                type slave; \n
                file \"$zonefiledir/$zone.db\"; \n
                masters { $master; }; \n
                allow-notify { $master; }; \n
                }; \n
        
                ";
        }
}

echo $zonefile;

?>

then you place a script on the slave dns server like that :
Code:
#!/bin/sh
#
# update bind zones every 20 minutes
#
PATH=/usr/bin:/bin:/usr/sbin
LOG=/var/log/dns-update.log

date > $LOG
wget -O /etc/bind/named.conf.local http://admin.yourdomain.com/tools/dns_export.php >> $LOG 2>&1
if [ $? = 0 -a -s /etc/bind/named.conf.local ]; then
        rndc reload >> $LOG 2>&1
else
        echo "Uh, oh...." >> $LOG
fi

Then check that the slave server gets a valid named.conf.local file.
If yes, take care to make a section like

Code:
<location /tools/dns_export.php>
     order deny, allow
     deny from all
     allow from <ip of your slave server>
</location>

so that not everybody can read your domain infos ...
That should do the trick basically ..
(This post was last modified: 03-06-2012 11:36 PM by ephigenie.)
03-06-2012 11:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Boss Online Offline
Junior Member
*

Posts: 11
Joined: Nov 2009
Reputation: 0
Post: #4
RE: how to setup nameservers
hello i have server and vps need nameservers, but cannot make it myself, if can please help.

IP Address 63.223.X.X
Gateway 63.223.X.X
Netmask 255.255.255.0
Nameserver 4.2.2.1
Nameserver 4.2.2.2

have this.

can i make ns1 adn ns2 ?
03-15-2012 07:48 AM
Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #5
RE: how to setup nameservers
please read the post above.
You need to put both NS into your config.
One as primary dns and one as secondary.
How you can distribute or create the zone files on the 2nd is written in my post above.
03-15-2012 08:19 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RouterRat Offline
Junior Member
*

Posts: 30
Joined: Mar 2011
Reputation: 0
Post: #6
RE: how to setup nameservers
Hi,

so I read the instructions above.

I am a little confused how the actual server setup will planned out.

So I have http://www.xhosting.com running on a ispcp on one server. Where all my other domains stay and this server is the main server.

You mean I need to set up another linux box, and then do all the mentioned scripting above?

Will I just install BIND9 on the new server or will I install ispcp?
if I install ispcp how can ns1.xhosting.com go to the new server?
and I will need 3rd server for ns2.xhosting.com right?



So I need a new Public IP for ns1.xhosting.com right?
05-23-2012 01:15 PM
Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #7
RE: how to setup nameservers
Yes you need 2 Servers minimum to have 2 independent DNS Servers.

If you use ispCP as well on the 2nd Server, you need to take care that you're not overwriting the domains vice versa... so the scripts need to be adjusted so every server is fetching the domains from the other one - and creates entries in the bind conf if not already existant.

But without overwriting the ispCP (new) zones of course ...
05-25-2012 04:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RouterRat Offline
Junior Member
*

Posts: 30
Joined: Mar 2011
Reputation: 0
Post: #8
RE: how to setup nameservers
Let's say my hosting company is http://www.xhosting.com

So you mean I'll have the main server which is hostname web1 and it has hosts xhosting.com and some clients I can access it as web1.xhosting.com etc.

This server will have clients too like 4 or 5 domain.
So for this 4 or 5 domain, can this server be already the name server?

like ns1.xhosting.com and ns2.xhosting.com ?

Let's say I don't need 2 independend nameservers.

Currently I am just parking domains and changing A record to my web server's IP from registrer.

Can I use ispCP as a name server?
05-26-2012 04:42 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)