Multi-tenancy DNS setup - how to? - dns

Sorry for the completely newbie question, but I really do not seem to understand how this would be done.
Can you automate the creation of sub-domains for a multi-tenant application that is hosted? Say for example a new customer signs up and specifies the sub-domain of choice. user1.mysite.com.
How do I automate the creation of the sub-domain and have it point to the single instance of my application? If yes, how do you go about doing this? Any samples or links would be most appreciated.
Thank You

You don't create subdomains, you create a wildcard DNS record.
*.mysite.com A 1.2.3.4

If you have owned the domain, you can create a subdomain manually in the configpage of your domain provider. The provider will have to config the subdomain for you(input subdomain and IP mapping into DNS Server). This could delay for some hours.
After that, you can create another mapping between your documentroot(where you application lives) and subdomain with . see more details here.

Related

How do I achieve this 2 web addresses for one website. i.e. www.administrator.sitename.com and www.sitename.com?

I want to create a website where I want a normal web address for site visitors i.e. www.sitename.com and the administrator of the website should have a web address like www.administrator.sitename.com. How do I achieve this? Just to clear things out, site visitors do not have the feature to create their own accounts on the website. There is only one user that exists i.e. Administrator.
Any other suggestions for implementing this system are also appreciated. This system will be implemented using the MERN stack so, please provide references accordingly.
This has nothing to do with MERN Stack. You basically need to do two things:
Create a subdomain. This can be done by visiting your domain registrar (like goDaddy or any website from which you've purchased your domain).
Host the admin panel on the subdomain.
So, let's say you have purchased example.com from GoDaddy. Now, login to your account on GoDaddy and add a subdomain admin.example.com. Follow the guide on how to add a subdomain for your registrar.
For GoDaddy, read this.
For Namecheap, read this.
That's it. Now you need to host two different websites (one for users and another for admins) one on main domain and another on a subdomain of your choice.

How to allow CNAME pointed to my server / how to use subdomain for a different server?

We create custom web apps for businesses and for the first time a client of ours has asked that instead of using our subdomain and instead of using a custom domain for their web app they would like to use their own subdomain for a domain currently hosted on another server.
For instance our domain is webapp.com and their domain is business.com. They would like app.business.com to be point to our name servers so we can continue hosting the web app for them.
I know it's possible to do this because we currently have outgoing CNAMEs on our server for help desks, etc, that aren't hosted on our own server but are using subdomains of ours.
Could you help me with what our client has to do on their zone editing side and what we need to do on our WHM/cPanel side to allow this?
NOTE: We had the client create a CNAME for app.business.com. pointed to our nameserver ns1.webapp.com and then we created an add-on domain for business.com and subdomain for app.business.com but when you try to visit app.business.com it gets the "Sorry!" cPanel page.
Thank you!
Alright I figured out how to do it on my own after a lot of testing & thought I'd post here to help others out in case they run across this in the future.
For the server with the subdomain on it have them create an 'A' record for that subdomain pointing to your server's IP address like so:
subdomain.business.com. ((note the extra period at the end is required))
TTL: 14400
Record Type: A
Pointing To: Your server's IP address.
Now on your server's cPanel you will need to create an addon domain for THAT subdomain (ie subdomain.business.com) - not for the actual business.com domain but for the entire subdomain subdomain.business.com with the folder being the root folder wherever you would like it to show.
That worked for me!
The CNAME should not point to your nameserver but your subdomain f.e. client1.webapp.com.
An other solution could be to add the subdomain app.business.com to your server and the client add an A record for the subdomain to your ip.

Understanding how the correct site gets served up to a domain?

This question is sort of dev ops or networking related. When I point a domain at a hosting provider, I use a fairly generic Nameserver, i.e. ns1.digitalocean.com.
I understand when I add a domain to my hosting service to manage, that the hosting service recognises I am the registrant and serves up the site to the domain - so my question is, if another customer of the same hosting service adds my exact domain to manage on his account (there are now two) how does the correct registrant of the domain get selected? I.e. if there are two accounts on Digitalocean and they both put in example.com to manage and the registrar of example.com is pointing to the generic ns1.digitalocean.com how does Digitalocean select the correct accounut and code base to serve up? Apologies if any confusion or lack terminology - I am a bit fuzzy on this whole process. Thanks, Nick
They wouldn't allow another user to add the same domain, otherwise it's a bug.

for Azure websites, do you need to keep the awverify DNS records?

I managed to get my custom subdomain name assigned to my Azure website, following this (very carefully):
link to azure custom domain name instructions
Is it necessary to keep the "awverify" DNS records after the custom domain names linkage has been established?
I deleted the awverify DNS record for the test subdomain, and was able to add another subdomain pointer to my azurewebsites test site.
Maybe I did not wait long enough. Does anyone else have any experience with this, to say one way or the other?
Not sure if I understand the issue you are running into... but the CNAME entry with the 'awverify' subdomain is used to "prove" to Azure that you own that domain when you are wiring up a custom domain name. Once that is established, you no longer need that.

Issue with subdomain pointing

Ok so here is is thing. I have a Big Commerce store, and a Fasthost hosting account. The domain is registered at Fasthost. The nameservers are pointed to the Big Commerce store. The store is usuing the main domain name (domain.com)
I am trying to set up a subdomain blog.domain.com and host wordpress on the Fasthost account. I am trying to set up DNS settings in the Big Commerce store to point blog.domain.com back to the Fasthost account where the blog will be. is this possible? How do I set this up correctly?
Usually your DNS provider for should provide you with an interface to manage your DNS records. Once you gain access to such an interface you just need to add an A record for blog.domain.com to point to your server at the other host. You might also want to add an NS record for the subdomain to point to the name servers at the other host.

Resources