Implement a wildcard sub-domain just like the one on Vercel, Netlify, WordPress, Tumblr, and many others

I’m not sure if this is the right place to ask this, but

I am talking about when you create a new blog with Tumblr, you can create your domain *, or when creating a deployment on Vercel or Netlify, you can have * or *

I get the gist that it’s maybe using a wildcard sub-domain, and some API since the user can create it through the app, but how do you build or what tools do you use to build something like that?

Or if you can point me out to where I can learn how to build something like that, I would be very grateful.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @meepomodeon,

This is a nice topic!

I actually recently built a similar thing for where users can get their own blogs based on their usernames, eg.

What I did was:

  • First create a wildcard A record DNS entry for * to point to my Droplet’s IP address.

  • Then I created a default Nginx server block that catches all of the subdomains, I did that by setting the server_name to:;, note the dot before the domain name.

  • As I am using Cloudflare, I took advantage of the free SSL certificate that they offer to cover all of the subdomains so that the subdomains were also secure.

  • Then finally on an application-level I would check the domain and server the relevant content for each site.

Hope that this helps! Regards, Bobby