Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have 2 servers. The MX records are pointing to server1 (which also has webmail on it).
The A record is pointing to server2.
Now if I type in the domain, it takes me to server2.
if I type of the domain.com/webmail, it takes me to server2 webmail.
I need to create a subdomain to point to server1 webmail.
how do I go about doing this ?

share|improve this question

migrated from stackoverflow.com Jun 17 '11 at 17:16

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

2 Answers 2

By subdomain you probably mean: webmail.domain.com

This is a two-part process. First, in your DNS, create the webmail host in the domain.com domain. This should be an A record that points to the IP of server1.

Second, configure the webserver on server1 to respond to requests for hostname webmail.domain.com. You should probably do this by creating a new virtualhost in Apache, setting its ServerName to webmail.domain.com, and setting its DocumentRoot to the directory where your webmail application is stored. Some more configuration may be necessary but that's hard to tell without more information from you.

Now, browsing to http://webmail.domain.com/ should show the webmail interface.

share|improve this answer

Two possible approaches:

  1. Create another A Record for server2
  2. Create a web redirect on server1 to reroute domain.com/webmail to server2

Either one or implementing both (your choice) will do what you described.

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.