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

I'm taking part in a custom shared hosting solution, and we need help with a solution for DNS or routing. Right now, a user domain points to their share, but it must have the secondary name in it.

eg: aaron.server1.mydomain.com

What is the best way for us to point user.domain.com to user.secondary.domain.com?

The redirect needs to work for http/ftp/ssh.

Simply put, we have a master server then slave servers, we want each user to have their own domain/subdomain. CNAME is the obvious answer, but is it the only solution, since if we have a lot of clients that will make A LOT of DNS records on our DNS server.

share|improve this question

closed as not a real question by John Gardeniers, Ward, rnxrx, HopelessN00b, voretaq7 Aug 31 '12 at 18:57

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
You need to rephrase your Question, as the answer in your current form is obviously DNS CNAMEs, which you would have known if you were serious with hosting. So I guess this is a mistake in your question. Rephrase it! –  Peter Meyer Mar 25 '12 at 9:42
    
Your question makes no sense. It may be clearer if you describe the problem you're trying to solve, rather than the partial solution you've asked how to implement. –  womble Mar 25 '12 at 10:04
    
Simply put, we have a master server then slave servers, we want each user to have their own domain/subdomain. CNAME is the obvious answer, but is it the only solution, since if we have alot of clients that will make ALOT of DNS records on our DNS server. –  Aaron Mar 25 '12 at 10:57

2 Answers 2

You can setup a CNAME record if you have control over DNS.

user.domain.com. CNAME user.secondary.domain.com.

It will also work for FTP and SSH if you distinguish clients only by login, not IP or domain name. Because the domain will have been gone after DNS resolution on clients side (prior to the connection). For HTTP the Host: header is at your service if you force HTTP/1.1 usage.

share|improve this answer
    
This was an obvious choice, but if after a few clients, it can start to clutter the dns records up. –  Aaron Mar 25 '12 at 12:23
    
How are you going to add client records without adding client records? No, you cannot magically make DNS entries appear of nowhere without "cluttering things up" –  gparent May 16 '12 at 14:24

Consider scripting. If you can write to a file that the DNS server can read then you can generate all the CNAME records from the script. It's easy enough to have BIND read several files and reload them periodically.

You also didn't specify if you're on linux or windows. I believe windows dns can read external config files just as BIND on linux can.

share|improve this answer

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