Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subdomain web/email setup

Status
Not open for further replies.

oregontarheel

Programmer
Feb 15, 2008
3
US
I'm fairly new at setting up complex DNS setups, but this seems like the sort of thing most ISP's would have to configure at some point.

We have a web application, foo.com. Each account in the system has subdomain.foo.com where they can access their application. In addition, they have the mail domain subdomain.foo.com. We would like to do the least possible amount of DNS configuration for each new account added. The following is what we have set up currently

web IN A [web server ip]
mail IN A [mail server ip]
web IN MX 5 mail.foo.com.
subdomain1 IN CNAME web.foo.com.
subdomain2 IN CNAME web.foo.com.

The idea is that each account's got the one CNAME record, which gets them to the web app as well as points them to the MX record which hangs off web.foo.com. This is working well for us in most cases, but some mail servers resolve a CNAME to its alias, and therefore they try to send email to user@web.foo.com, which is not set up as a valid address since the correct one is user@subdomain1.foo.com. And we bounce the mail. I can solve by setting the A record to the web server and the MX record to mail server for each subdomain, but is there an easier way?

Thanks in advance.

 
Don't you really want the subdomain(s) to be A records instead?

subdomain1 iN A webserverIPaddress
subdomain1 IN MX 5 mail
...

The only use for the A/CNAME is so you can map subdomain1.foo.com to web.foo.com, and the A record doesn't have the limitations of the CNAME.

eugene
 
the reasoning for wanting to use the subdomain as a CNAME to web is because we are doing web hosting using amazon ec2 and we need to be able to change the load balancer (web) ip address if need be. Therefore we need to update each A record, instead of just changing web's A record. The problem is we are using DynDns otherwise I would just use a regular expression on the zone file. Guess I gotta do one of these:

use a static load balancer ip
run my own dns server
do a bunch of legwork changing A records
 
If you have a firewall/router in front of your lb, you could always use address mapping (provided the alternate load balancer is also behind your firewall).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top