multiple vps same domain ns configuration

superweb

New member
Joined
Feb 12, 2024
Messages
6
I am trying to configure a second VPS as NS Webhosting Server whereas I fail to set up the name servers correctly.
At the moment, I am working with two VPS both running apache on CentOS and DirectAdmin control panel.
VPS1 reseller hosting, no admin access. (where domainx.com's NS are pointing to ns1.vps1.com, ns2.vps1.com. AND an A record for 'server' is present thats pointing to the ip of VPS2 for its hostname)
VPS2 full access. (server.domainx.com)

What I am trying to set up now is the NS ns1.domainx.com, ns2.domainx.com on VPS2 that needs to handle new domains that have these NS set.
Therefore, I have created two other A records (ns1 & ns2) on VPS1 under DNS settings with its values VPS2's IP. Below for a better overview.

On domain registrars settings:
DOMAINX.COM
NS1.VPS1.COM
NS2.VPS1.COM

On VPS1 domainx.com - DA DNS settings :
NS1 A x.x.x.x (IP of VPS2)
NS2 A x.x.x.x (IP of VPS2)

YDOMAIN.com - not resolving to the user directory
NS1.DOMAINX.COM - not resolving.
NS2.DOMAINX.COM - not resolving.

The nameserver settings in DA on VPS2 is set to NS1.DOMAINX.COM,NS2.DOMAINX.COM

What I have tried is to add allow-transer to any and notify-to-soa yes; in named.conf (and restarted) still no succes.
I have also tried to add NS records for the domainx.com on VPS1 DA DNS settings:
ns1 NS vps2-server-IP
ns2 NS vps2-server-IP
but this did not really made sense to me. I am thinking I am missing some other configuration but I didn't figure out yet what..

Any ideas?
 
Last edited:
On VPS1 domainx.com - DA DNS settings :
NS1 A x.x.x.x (IP of VPS2)
NS2 A x.x.x.x (IP of VPS2)
If domainx.com is on vps2, then the A records should only be on vps2.
On VPS1 you should have only the NS records.

On VPS2 where domainx.com and it's dns is residing, you need both the ns1 and ns2 A records and NS records.
 
Sorry, my keyboard protested, it's working again now. This was also required:
I have also tried to add NS records for the domainx.com on VPS1 DA DNS settings:
ns1 NS vps2-server-IP
ns2 NS vps2-server-IP
NS records are not ip's. This should be.

ns1 NS ns1.domainx.com ns2 NS ns2.domainx.com

Same on vps1.
 
Ehmz... if you want to have both domains on both servers, like redundant, then I don't think this will work.
Normally another domain is on one of the vps systems and then the ns2 of both are switched in the multiserver setup.
 
Hi Richard, first of all thank you for your reactions.
I have domainx.com residing on VPS1 (reseller hosting) since I have set the NS for the domainx.com to NS1.VPS1.COM on the domain name registrars control panel.
if you want to have both domains on both servers

I want to set up NS for the second vps as ns1.domainx.com, that's why I only want to use ns1 and ns2 records of the domain pointing to VPS2.
Using that way I want to achieve that I can route and configure new domains in the future to VPS2 by setting their NS to ns1.domainx.com and by creating a new account/user for them on VPS2....and unfortunately I fail at that part.
 
As for my reactions, you're welcome.
But I'm wondering if you are not making things too difficult for yourself.

You're not Dutch (Nederlands) right? Because that would make things a lot easier for me with explaining.

What I don't understand is the following. If you want to configure new domains in the future to VPS2 anyway, why do you not setup the nameservers on VPS2, including domainx.com?
Because if you want to create a user on vps2, you need an admin or reseller account on VPS2. Then the DA on VPS2 will decide which nameservers to use.

If you configure domainx.com on VPS2 then this makes life a whole lot easier and it works instantly.

As for the registrar, it's quite easy to change the glue records (ip adressses) for ns1 and ns2.domainx.com to another VPS.

So looking at it this way, I don't quite understand what you still want with VPS1 as you don't have admin access there anyway. Maybe it's because I'm not native English, or maybe it's because you have a specific reason to keep using VPS1 which I'm not aware of or don't understand. In that case sorry about that.
 
allowing query to any; in named and allowing firewall port 53 which was blocked, worked like a charm!
What I have tried is to add allow-transer to any and notify-to-soa yes; in named.conf

@Richard there are services running on VPS1 that I can't move easily to the second VPS. That's why I need the domain pointed to the first VPS in order to keep system running.
I don't quite understand what you still want with VPS1 as you don't have admin access there anyway
 
services running on VPS1 that I can't move easily to the second VPS
Thank you for explaining, I got a bit confused as to where domainx was residing as it's often more easy to do if domainx is residing where you have full access.

Please do never use allow-transfer to any that is very unsafe. Use the according vps ip address in that line instead of any.
Same for allow-notify if used.

worked like a charm!
Just to be sure.... So it's working now like you wanted?
 
I have removed the allow transfer as per of your advise. Thank you for that.
You'r welcome. But if I'm not mistaken, the default setting is also any.
So to be sure, you can best set it like this:
allow-transfer {"none"; };
and then restart named/bind.
 
Back
Top