1

I am stuck in a bit complicated situation(complicated for me, might not be for you).

What I have:

I have 2 virtual private servers on two different IPs eg. 192.0.0.1, 192.0.0.2(let's name these vps1 and vps2) and one domain name eg. foo.com.

What I want to produce:

I want to host multiple websites on these two vps eg. on vps1, I want to host one-bar.com, two-bar.com and, on vps2, I want to host three-bar.com, four-bar.com.

What have I done:

I have created 4 glue records with my registrar of foo.com ie. ns1.foo.com, n2.foo.com, ns3.foo.com, ns4.foo.com,

  1. ns1.foo.com and n2.foo.com resolve to IP address of vps1 (192.0.0.1)
  2. ns2.foo.com and n3.foo.com resolve to IP address of vps2 (192.0.0.2)

I updated,

  1. nameservers for foo.com, one-bar.com and two-bar.com to ns1.foo.com and n2.foo.com.
  2. and, nameservers for three-bar.com and four-bar.com to ns3.foo.com and n4.foo.com.

I have installed webmin on both vps to manage websites and dns, This is stripped down copy of my zone files,

vps1 and domain foo.com:

@ IN SOA ns1.foo.com. root.ns1.foo.com. ( 1465031833 10800 3600 604800 38400 )
foo.com. IN A 192.0.0.1
ns1.foo.com. IN A 192.0.0.1
ns2.foo.com. IN A 192.0.0.1
ns3.foo.com. IN A 192.0.0.2
ns4.foo.com. IN A 192.0.0.2
foo.com. IN NS ns1.foo.com.
foo.com. IN NS ns2.foo.com.

vps1 and domain one-bar.com:

@ IN SOA ns1.foo.com. root.ns1.foo.com. ( 1465031833 10800 3600 604800 38400 )
one-bar.com. IN A 192.0.0.1
@ IN NS ns1.foo.com.
@ IN NS ns2.foo.com.

vps2 and three-bar.com:

@ IN SOA ns3.foo.com. root.ns3.foo.com. ( 1465031833 10800 3600 604800 38400 )
three-bar.com. IN A 192.0.0.2
three-bar.com. IN NS ns3.foo.com.
three-bar.com. IN NS ns4.foo.com.

What I am able to produce: Websites on vps1 ie. foo.com, one-bar.com and two-bar.com are resolving properly but, websites on vps2 aren't.

Can anybody help me to find out what am I doing wrong?

PS: Thanks in advance!

  • 1
    A given nameserver can be authoritative for multiple zones (domains). So you do not need 4 nameservers. You can use the same set of 2 for all your domains and just configure them with records for your domains. Also note that if you do not want to handle DNS and nameservers configuration this is probably a service that your registrar/hosting company can deliver for you. Finally, per RFC2606 do not invent domain names when you want examples, just use `example.com` or `example.net` – Patrick Mevzek Feb 27 '18 at 03:35
  • @PatrickMevzek alright, I will keep that in mind. – Pankil Joshi Mar 08 '18 at 05:53

2 Answers2

0

NS1 is the primary DNS for foo.com. you should add records for all 4 sites, one-bar, two-bar , three-bar and four-bar to both NS1 and NS2. NS2 should act as a redundant DNS server for you.

  • So, you mean I don't need ns3.foo.com, ns4.foo.com even if I want to point three-bar and four-bar to vps2? – Pankil Joshi Feb 26 '18 at 07:45
  • yes. you dont need so many name servers. right now you have two vps running dns. so then you will have two name servers, ns1 and ns2, and they should both have the same records. – Bahrain Admin Feb 26 '18 at 09:26
  • Thank You, It helped. Issue was with the bind server (it was stopped). But, I switched to two name-servers only for ease of maintenance. – Pankil Joshi Mar 08 '18 at 05:58
0

The issue was a stupid mistake, bind server on vps2 was stopped because of my mistake. It is working now. Thanks to everyone who tried to help.

Pankil make stupid mistakes, don't be like Pankil :p