Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im just starting to look at deploying a webpage and get into the joy of DNS etc. And im wondering how you set up multiple web-servers all with thier own hostnames/public IP addresses, and yet have them serve up a webpage from one domain.

For example, lets say you have a website, and an A record in DNS that points at it's IP address of .

You want to have two servers, prod1 and prod2 with some kind of load balancer in front of them for fail over reasons.

The way I see it you would want to have the hostnames of these servers as and and perhaps

How would you set up the DNS so this would all work. ie you could ssh to any of the server domains,, or and also just use the url to go to the website. And would all these server names be resolvable from the public internet and is that safe?

This would be a linux environment, for arguments sake ubuntu, a django framework dynamic website, running in apache 2.2

Cheers Mark

share|improve this question
up vote 2 down vote accepted

This is actually very straightforward but exactly how you do it varies based on the LB you use.

In your example you would simply have an A record for that points to a virtual IP address presented by the LB. The LB will periodically probe both Prod1 and Prod2 to check they're up (and sometimes how busy they are) and based on that hands each request to a server to work on. If required you can create additional A records for Prod1 and Prod2 if you wish to talk directly to a specific server with the LB ignoring that request.

Here's some extra detail;, which is Prod1's real IP, which is Prod2's real IP, which the LB creates and points at both AND (you can use either DNS names or IPs).

Request comes to the LB at, the LB knows both are up so sends the request to, the next request goes to and so on.

The example above uses a 'round robin' rule to balance the traffic but there are lots of other rules you could use instead (i.e. who's least busy) but that depends on the LB being used.

Is that ok? let us know if not and we'll come back to you.

share|improve this answer
Yes kinda. So is pointed at a virtual address of the LB? Im presuming that the LB then has two IP addresses? Or does have an A record that points just to the LB IP address? – Mark Mar 22 '10 at 1:35
Yes does point at the VIP on the LB but it can have one or more IPs depending on config. – Chopper3 Mar 22 '10 at 9:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.