0

I am thinking of providing users their own personalized subdomain (ex. johndoe.mydomain.com) I understand I can do this with a wildcard CNAME entry. The problem is that I have another subdomain that I currently use for development (ex. dev.mydomain.com)

I would like to know if it is possible for me to catch all subdomains and point it to a generic subdomain on the same root domain while keeping my development subdomain.

BTW, I have access to SSH but not on the OS itself (It's a shared hosting)

Thanks in advanced.

  • Considering that this is shared host, will your hosting provider allow you to create subdomains with external software? – Burgi Oct 10 '16 at 19:32
  • no. it's does not. – Bobo Filipino Nov 28 '16 at 1:46
  • Then we cannot help you. – Burgi Nov 28 '16 at 8:45
0

As a client directly asks for a specific domain you'd just keep your dev domain on a DNS level. So even if you have a wildcard CNAME record a client looking for the dev domain would ask the DNS server for that specific domain and it should return the more specific one. This might depend on the arrangement in the zone file (I'm not entirely sure).

If you're worried just make it a sub-sub domain as an example johndoe.users.example.com or consider just setting up normal A records that point to your server. What's the reason you wouldn't want to do that? It would allow you to receive a HOST header which contains the user.

  • So does that mean that a specific subdomain overrides the wildcard entry? – Bobo Filipino Oct 7 '16 at 9:47
  • It should, yes. It might depend on your DNS server software though. I'm not a hundred percent sure how e.g. bind parses the zone file so depending on that it might be important to have the more specific definition before the more generic one. – Seth Oct 7 '16 at 9:50
  • I tried your suggestion and created a for "generic" subdomain called dashboard (i.e. dashboard.mydomain.com) and creating a wildcard "*" CNAME pointing to that subdomain. Going directly to dashboard.mydomain.com displays the correct homepage but entering something like user1.mydomain.com displayed a welcome page from GoDaddy. I'm trying to locate that default welcome page from the files on the server but can't find it. – Bobo Filipino Oct 7 '16 at 10:10
  • So you did follow this setup? Mind the hint that it won't work with web hosting offers from GoDaddy. Oh and what's your actual objective? You might not be able to tell what the original request/user was this way. – Seth Oct 7 '16 at 10:18
  • My goal is to give then their personal subdomain. I will extract their username from the subdomain name. – Bobo Filipino Oct 7 '16 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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