Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Hopefully a very simple question ...

With a Linux server how can I get 3 different domains to all point at the same server and show exactly the same application, but with the different domains still showing in the browser address bar?

Is it just a case of setting the DNS for each domain the same or would the server require some configuration too?

share|improve this question

migrated from May 20 '11 at 3:11

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

Assuming this is an Apache web server, you would need to point all of the domains to this server, and then configure Apache to serve the site site to these three domains. Check out the docs here: It depends on how your server is configured, but you most likely just need to add the different domains as multiple aliases.

share|improve this answer
sorry for the delay in response. the domains are all pointing at the server but it's shared so i don't have access to the server's http.conf file for setting up a new vhost. apparently i can do this with an .htaccess file but i'm not sure how to go about that? – davidhyland Jun 8 '11 at 16:09
so in summary, each of the 3 domains needs to point to the same application folder on the server where i will use $_SERVER['HTTP_HOST'] to determine the domain and change the site config appropriately (unless there's a better way?) – davidhyland Jun 8 '11 at 16:10
Are you given a specific folder on this server to put your application? If so, you might just need to point the domains there then. You won't know for sure if you don't have access to apache, but you can just try it in DNS alone, and it will likely work as you expect. – Paul Kroon Jun 8 '11 at 17:16

Assuming you have a simple web server set up: Set the "A Record" for each of the domains to point to the same ip address. This would be done from your domain provider's (e.g. godaddy's) control panel.

share|improve this answer

Nope - it's all done in the DNS server: See

share|improve this answer

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.