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

I need to point two domain names to one server. It is an Apache Linux server.

I understand that I can create two A records in the DNS pointing to the same IP. But how do I configure the Apache server, mail server, etc.?

share|improve this question

closed as not constructive by Ward, Iain, Khaled, mailq, quanta Nov 1 '11 at 9:49

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

3 – mailq Nov 1 '11 at 9:33
up vote 1 down vote accepted

In your DNS, point both domains to the same IP.

In httpd.conf add a ServerAlias directive for that domain:

<VirtualHost *:80>
# ...

(You may need to look in another file if httpd.conf has any includes in it.)

Then restart Apache:

service httpd restart

For details on configuring Apache name-based hosts look at:

share|improve this answer

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