Multi server with single domain

ISOS6

Verified User
Joined
May 7, 2009
Messages
322
Location
Erbil, Tarin Hills, Iraq
Hello,

I want to set up multiple servers with just one domain. For example, domain.com. What is the best way to do this?

If server A has the main domain domain.com
Can I create server B with the same domain.com?
I know this way will break DNS.

Or should it be:
Server A with srv1.domain.com
Server B with srv2.domain.com
Server C with srv3.domain.com

With main domain I mean where I add the domain admin account on the User level


Know or use some one several servers and have a good structure?
 
Are you asking for hosting the same content from two servers?

You can set up server B to serve the same domain (it should have it's own hostname and it's own IP#s and DNS entries. Haqving two A records for a site will not break DNS but it may not do exactly what you expect. Every time a visitor queries DNS, it will return both IP#s, and your visitor's system should go to the first IP# it gets for that site.

Often the easiest way to do this is to use one of the machines as ns1, and the other as ns2, each reporting one of the two IP#s. Generally then the least busy machine will return the A record first, which means it will get that visitor.

How you keep the site synchronized across two servers is up gto you; the details depend on whether it's a static site, or a database driven site, and if the latter, whether contents can be updated in realtime by users, or only one person.

How you set up DNS and route visitors between servers is also up to you.

Note that this could be more complex than it seems at first, and it usually still results in a single point of failure.

Jeff
 
...I want to set up multiple servers with just one domain. For example, domain.com.
Or should it be:
Server A with srv1.domain.com
Server B with srv2.domain.com
Server C with srv3.domain.com
You will have to go to your domain registrar and setup "ns3" and "ns4" with the IP of Server B. Then you will need to add A records for "ns3" and "ns4" that point to the IP of Server B to the zone file for the domain.
You will also need to add an A record for "srv2" in the zone file for the domain.
Once all the DNS is setup you should be able to use "ns3" and "ns4" to point domains to Server B with hostname "srv2.domain.com"
 
@Themis,

I don't think the original poster was asking how to host multiple domains on two servers, but rather how to post one specific domain, on two servers, to share load and so the site would still be available even if one server was down.

@ISOS6,

Has your question been answered?

Jeff
 
@Themis, I don't think the original poster was asking how to host multiple domains on two servers...
Hi Jeff,
As far as I can tell, ISOS6 wants to setup a server with srv1.domain.com and ns1 + ns2
A second server with
srv2.domain.com and ns3 + ns4
A third server with srv3.domain.com and ns5 + ns6
and so on... using only 1 domain name, without necessarily using the multi server option.
 
I didn't even think of that. Either way, ISO6 now has the information needed :).

Jeff
 
Thanks for your feedback!

That's exactly what I want, Themis.

But I have now set up the servers and made the following, it works great.

Server A: srv1.domain.com with DN1 and DN2 with main domain in User Level
Server B: srv2.domain.com with DN3 and DN4 without domain in User Level.

I just pointed DN3 and DN4 to IP addresses on Server B via Glue records.
And I have pointed dn3.domain.com and dn4.domain.com the DNS settings on Server A. Looks like it works. I also use Multi server option in the DA so that users/records will not be duplicates.
 
Hi, this is a server arrangement I am considering and I just wanted to see if someone could offer a url to the body of documents which would is/include the above referenced "ISO6" and "ISOS6" information?

search engines return such an enormous amount of hits on ISO images, IOS devices and whatnot -- I'm guessing it's a reference to part of the RFC but don't understand the connection between ISOS6/ISO6 and RFCs.
 
HA! HA! HA!

Wow. How embarrassing.

Thanks SeLLeRoNE

PS: glad to know someone here isn't afraid to tell a person their fly is open ;-)
 
Last edited:
I have went ahead and rolled out a configuration similar to ISOS6. Two geographically separate VM.

Both server share these common configuration aspects:

  • DA 1.45.0 - CentOS 6.5
  • 2 IPv4 - only utilizing 1 per server (server IP and 1 NS)
  • example.com = single TLD under admin user
  • multi-server ON : Zone Transfer: off | Domain Check: on | User Check: on
[ srv1.example.com ]
Code:
			    Local
(zone)			Data	Mail
srv2.example.com	No	No
-----------------------------------------------
ftp			A	222.222.222.222
srv2.example.com.	A	222.222.222.222
localhost		A	127.0.0.1
mail			A	222.222.222.222
pop			A	222.222.222.222
smtp			A	222.222.222.222
www			A	222.222.222.222
srv2.example.com.	NS	ns2.example.com.
srv2.example.com.	MX	10 mail
srv2.example.com.	TXT	"v=spf1 a mx ip4:222.222.222.222 ~all"
localhost		AAAA	::1

			    Local
(zone)			Data	Mail
srv1.example.com	No	Yes
-----------------------------------------------
ftp			A	111.111.111.111
srv1.example.com.	A	111.111.111.111
localhost		A	127.0.0.1
mail			A	111.111.111.111
pop			A	111.111.111.111
smtp			A	111.111.111.111
www			A	111.111.111.111
srv1.example.com.	NS	ns1.example.com.
srv1.example.com.	MX	10 mail
srv1.example.com.	TXT	"v=spf1 a mx ip4:111.111.111.111 ~all"
localhost		AAAA	::1

			    Local
(zone)			Data	Mail
example.com		Yes	Yes
-----------------------------------------------
ftp1			A	111.111.111.111
example.com.		A	111.111.111.111
localhost		A	127.0.0.1
mx1			A	111.111.111.111
mx2			A	222.222.222.222
ns1.example.com.	A	111.111.111.111
ns2.example.com.	A	222.222.222.222
www			A	111.111.111.111
example.com.		NS	ns1.example.com.
example.com.		NS	ns2.example.com.
example.com.		MX	10 mx1
example.com.		MX	10 mx2
example.com.		TXT	"v=spf1 a mx ip4:111.111.111.111 ~all"
localhost		AAAA	::1
[ srv2.example.com ]
Code:
			    Local
(zone)			Data	Mail
srv2.example.com	No	Yes
-----------------------------------------------
ftp			A	222.222.222.222
srv2.example.com.	A	222.222.222.222
localhost		A	127.0.0.1
mail			A	222.222.222.222
pop			A	222.222.222.222
smtp			A	222.222.222.222
www			A	222.222.222.222
srv2.example.com.	NS	ns2.example.com.
srv2.example.com.	MX	10 mail
srv2.example.com.	TXT	"v=spf1 a mx ip4:222.222.222.222 ~all"
localhost		AAAA	::1

			    Local
(zone)			Data	Mail
srv1.example.com	No	No
-----------------------------------------------
ftp			A	111.111.111.111
srv1.example.com.	A	111.111.111.111
localhost		A	127.0.0.1
mail			A	111.111.111.111
pop			A	111.111.111.111
smtp			A	111.111.111.111
www			A	111.111.111.111
srv1.example.com.	NS	ns1.example.com.
srv1.example.com.	MX	10 mail
srv1.example.com.	TXT	"v=spf1 a mx ip4:111.111.111.111 ~all"
localhost		AAAA	::1

			    Local
(zone)			Data	Mail
example.com		Yes	Yes
-----------------------------------------------
ftp2			A	222.222.222.222
example.com.		A	222.222.222.222
localhost		A	127.0.0.1
mx1			A	111.111.111.111
mx2			A	222.222.222.222
ns1.example.com.	A	111.111.111.111
ns2.example.com.	A	222.222.222.222
www			A	222.222.222.222
example.com.		NS	ns1.example.com.
example.com.		NS	ns2.example.com.
example.com		MX	10 mx1
example.com.		MX	10 mx2
example.com.		TXT	"v=spf1 a mx ip4:222.222.222.222 ~all"
localhost		AAAA	::1

Observations so far based on one domain and one user, admin:

At the start I had zone transfer ON and the example.com zone was synced and thus tied to a single server. I can't recall what else may have changed but it did suffice to trade server zones in an simple way. At this point I turned off Zone Transfer and edited the zones to basically what is shown above.

  • from my location in the eastern US I typically get the srv2 hosted example.com as its closer.
  • stopping named on srv2 produces example.com from srv1
  • mail destined for [email protected] will go to either MX based on various factors I guess. I've only tested stopping named IIRC. More tests like stopping exim and/or dovecot will be useful.

So far the configuration produces the effect I was attempting. The content for example.com will be essentially static.

E-mail I just pull both MX1 and MX2 into a zimbra based service I aggregate all my mailboxes in.

Hurdles and Problems I am expecting:

  • dns checking sites produce a couple chirps but may be unable to digest the config here
  • would like to exclude example.com zone from multi-server zone transfer if possible. Have not read up on the possibility so far -- so I can turn ZT back on and have this example.com poor-mans load balance, fail over type behavior.
  • might have to add additional one NS to each server to allow provisioning for clients.
  • plenty more since I really should have experimented with a handful of different users/user types and digest the effects on the various multi-server settings.

What I am actually trying to accomplish:

The vision is to have example.com use resiliency of having two servers for the better availability of my own email and domain. Clients would simply be on one or the other as regular shared hosting services behave (no mix/mirror of MX, ftp, etc).

Further, although I have 2 IPv4 per VM I would like to use primary server IP for all services and 1 NS per VM, then use and provision to clients that same NS combination.
Client provisioning be either srv1 or srv2, single server scheme but with the above NS provisioning and account name uniqueness among all servers. (..all MS features ON ? )

FWIW

I welcome any comment on failings I may experience in the scheme, things to try/test or simply pointing out that since I previously wrote this I need start from scratch or hire someone to clean up this mess. :-)

If any of you DA & DNS experts who regularly frequent the forum have interest and would like to examine the arrangement closer, feel free to PM me for basic info (TLD, IPs) or even credentials for DA and/or servers.

I'll probably continue to work on some other DA and/or server learning so it'll probably stay as is for some more days before I start breaking things and/or start over.

Finally...

At least a few (!) basics have continued to elude me for some reason.. Any clarifications welcome!

  • admin user + hosted domain & e-mail - pros/cons
  • host (svr.example.com) also hosting the TLD - pros/cons
  • SSL=? (directadmin.conf) - '0' will not allow https on 2222, '1' won't allow http. This is what I have observed.. Correct operation?
  • what do experts do with default Apache /var/www ..redirect, server status or ?

Thanks for reading and hope the info presented may be useful to someone, and me. ;-)
 
Last edited:
The above arrangement was live and continued to work rather nicely.

Since dealing with the heartbleed bug I decided to regress and go back to learning more on the clustering and other features that become sort of tedious with the arrangement above.

Additionally since none had questions or input on the topic it seemed like I'd best move on to a cookie cutter arrangement which more closely relates to the usual deployment of DA.

I still welcome any comments / confirmations of the above arrangement someone else may experiment using.. and actually I may go back to that later and work out kinks once I get more DA use & configuration knowledge under my belt.

That being said, requests for checking out the above configuration are now unsolicited. ;-)
 
Last edited:
From my point of view, front end availability of a simple static website is fairly easy; all you need is to host it on two servers and point it to both those servers when both are available, but when one isn't, only to the one which is available.

Easiest way to do that is to run DNS for server one on server one, and DNS for server two on server two. I've discussed this in previous threads.

But simply put: ns1, on server one, points domain name to server one, and ns2, on server two, points domain to server two. The way DNS works, when the site visitor enters the domain name into his browser, his local resolver checks the IP#. If it has it, it uses it to route the packets. If not, it gets it. When it sends a DNS request it sends it to all authoritative nameservers, and excepts the first rsponse it gets. So if both servers are active it the site may resolve to either server. If only one server is active the site will only resolve to one serer (presuming both DNS and HTTP are running properly). Kind of like a poor man's load scheduler.

The backend stuff is much more complex. If the site isn't a static site how do you get changes made on one site to the other? (For example, go only so far as to consider this forum.) That's best handled by some kind of MySQL replication.

For email it can either be quite simple (for example, if you and your users are all using POP3) or much more complicated (if anyone is depdnign on IMAP. Because POP3 doesnt care which server has the email, whereas IMAP does. So if anyone is going to use IMAP you'll need a mail system which stores everything in MySQL, and a similar MySSQL replication setup.

Then of course you need the proper information on both systems set up to know which domains to accept email for, to relay for, to send for, etc. Best a system with no such thing as a primary email server, but true replication. Which is well beyond both DirectAdmin itself and this forum. You can buy what's often called Enterprise Email from many providers, including many specifically set up to sell through resellers, or you can build your own from scratch. When choosing a system to resell be sure you undersand if they use local or geographically diverse redundancy. You may want the latter, but so far in my searches no one seems to offer it.

I'm currently studying several Enterprise Email solutions which we'll be able to sell to resellers but I'm not ready to anounce anything yet.

So what else would you like to cover :).

Jeff
 
It may not make sense, but one of the areas I was going to study and test more about the above setup was:

- find a method to allow multi server -> zone transfer = ON without the local hosted duality of the 2nd level domain name being shifted to only one server in it's zone.

I have to scramble right now, so will edit/add more to this reply once I can [re]read your reply Jeff.
 
You can have two A recors for a fqdn in a zone, and both will be returned, in a random order. The problem is that if both are returned the local system could choose to visit either one, and one may not be available.

That's why I have each server return it's own IP#.

Jeff
 
Back
Top