-2

I am developing an application which process is like below:

  • User do registration
  • System will create a sub-domain as the username registered. i.e : xyz.abc.com
  • User will build his webpage under this sub-domain (xyz.abc.com)
  • if user got a domain (example.com), user will be able to link the domain with the sub-domain that was created during registration.

My Question is: To link the Domain (example.com) with the sub-domain (xyz.abc.com) what need to do? Note: user will browse the domain (example.com) and will view the content from Sub-Domain (xyz.abc.com). Do I need to do CNAME, A Record or ALIAS configuration?

  • It would help to know what platform you are developing on and a little more about your environment. Your question sounds a lot like you are wanting tips on managing DNS or like you are trying to build a web interface that manages DNS, but without more information, I doubt you will get an accurate answer. – Bill Nov 15 '17 at 19:27
  • When companies like Microsoft do this, they don't make the DNS changes for the customer automatically, they list instructions for how the customer can do it themselves. That's because usually the DNS is not under Microsoft's control. You might want to do it like the big companies do it, since they do it that way for a good reason. – Todd Wilcox Nov 15 '17 at 20:18
  • 1
    The Application is developing using PHP Laravel Framework. There will be an option for the user to input his own domain and tag the Domain with the Sub-domain he own within my application. If A Record or CNAME requires to update in there own Domain Panel, they will do it and point the A or CNAME to my Web-Application. For specifically they will point there domain to the sub-domain that they own within my application. I could check if the CNAME or A record has been updated using API. @Bill – kazi Nov 16 '17 at 14:42
  • I would like to give instruction to my subscriber how they could point their Domain to the sub-domain they own within my Web Application. So if they own "example.com" and want to point this domain to the sub-domain "xyz.abc.com" they own within my web application. How they can see all the content from sub-domain "xyz.abc.com" by browsing the domain "example.com" ? @ToddWilcox – kazi Nov 16 '17 at 14:46
0

There are two layers in this.

  1. The web server needs to know the external domain in order to serve the correct content requested in the HTTP Host: header. This is a HTTP protocol thing: DNS can't do this for you as it, in all its forms, only resolves names to IP addresses. The connection to the server is always established using the IP address alone.

    You wouldn't want your users to write freely anything to your web server configuration, so you need to check at least:

    • The syntax: it must be a valid FQDN (minus root .).
    • The maximum sub domain level.
    • That there is a valid corresponding A record in DNS.
    • Whether the user has right to use this domain or not. You could e.g. require an additional example.com. TXT "kazi=userid" record to confirm that someone is not trying to use a domain of another user. (A CNAME instead of A would do this for a sub-domain to sub-domain arrangement, but you can't use it for the domain itself.)
  2. Who is responsible of the DNS? Your question does not state that you are willing to host the DNS for custom domains, as well. For external DNS you must write a proper documentation on what records are required for using your service.

  • I would like to give instruction to my subscriber how they could point their Domain to the sub-domain they own within my Web Application. So if they own "example.com" and want to point this domain to the sub-domain "xyz.abc.com" they own within my web application. How they can see all the content from sub-domain "xyz.abc.com" by browsing the domain "example.com" ? @Esa Jokinen – kazi Nov 16 '17 at 14:56
  • Exactly as in this answer: by configuring your web server to accept this domain. They can't do it in their DNS configuration alone. You'd have to provide an interface to add own hostnames or add them manually. – Esa Jokinen Nov 16 '17 at 15:07
  • Thanks. Could you please explain this part in another way, "You'd have to provide an interface to add own hostnames or add them manually. –" @Esa Jokinen – kazi Nov 17 '17 at 15:14
  • Otherwise, your webserver wouldn't know which content to serve. – Esa Jokinen Nov 17 '17 at 15:22
  • Okay. So you are suggesting to set host name for each sub-domain? If user-1 own Domain : example.com and got sub-doamin : abc.xyz.com in my web platform. Now he needs to point example.com of this sub-domain :abc.xyz.com ? So that, he could browse domain and see the content of sub-domain ? @Esa Jokinen – kazi Nov 19 '17 at 8:50

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.