Creating subdomain on the fly

Hi all,

I saw that there are many web application nowadays that is able to give a subdomain for the user id upon registration.

So if I register as jpartogi on blabla.com, I can get http://jpartogi.blabla.com for my default page. How do we do that? Do we write BIND config upon user registration? Or is there a simpler way to do it?

Thanks.

2 Replies

Wildcard subdomains.

*.blabla.com. 86400 IN A 123.45.67.89

Everything points to 123.45.67.89. No need to add records for specific subdomains. The rest is up to your webserver. You'll probably need a regex in your virtual host definition, or else use the default virtual host to catch everything.

ServerAlias and VirtualDocumentRoot will do what you want "on the fly" if you're using Apache.

Lighty can do similar using modsimplevhost too.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct