-4

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.

3
  • 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! Mar 25, 2012 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, 2012 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, 2012 at 10:57

2 Answers 2

1

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.

2
  • This was an obvious choice, but if after a few clients, it can start to clutter the dns records up.
    – Aaron
    Mar 25, 2012 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, 2012 at 14:24
1

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.

Not the answer you're looking for? Browse other questions tagged .