Score:0

Can subdomains work without being registered in the DNS records/

in flag

I have made a web-application on my localhost which provides a platform which gives different businesses their own page on that platform. Each business has it's own subdomain.

So, business1.example.com business2.example.com business3.example.com ...

On my localhost, my code just interprets the URL as a string and extracts the subdomain part. If that subdomain is linked to a business in my database the page is served, otherwise a 404 is returned.

This works fine on my localhost. But can this also work on the internet?

  • There are an infinite amount of subdomains possible
  • sfkojfioej.example.com should work too as URL, but just return a 404.
  • The subdomains are not registered in the DNS-records.

Especially the last point bothers me. Is it possible to achieve this without registering each subdomain in the DNS records?

Score:2
cn flag
Bob
  • The subdomains are not registered in the DNS-records.

Especially the last point bothers me. Is it possible to achieve this without registering each subdomain in the DNS records?

The sub domains must exist in DNS because otherwise people can't resolve them.

But you don't need to explicitly create a DNS record for each subdomain, you can create a DNS wildcard record *.example.com which will be used for any subdomain that is not explicitly created.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.