DEV Community

Cover image for What Wait Why: Heroku Doesn’t Want You to be Naked

What Wait Why: Heroku Doesn’t Want You to be Naked

Evan on November 19, 2018

www. is a subdomain. It took me forever to realize that. When reddit switched to their new UX, they created an old.reddit.com that you could use t...
Collapse
 
nickjj profile image
Nick Janetakis

If you really want to have your mind blown, your domain name is actually a sub-domain that you purchase from a TLD such as com or org.

Domains are read from right to left.

Collapse
 
alexjackhughes_34 profile image
Alexander Hughes

You've literally broken the internet for me.

Collapse
 
enzzc profile image
Enzo Calamia

Sure, but the real question is to know if the domain (or "subdomain") has its own SOA record or not.

Collapse
 
prnthh profile image
Pranith Hengavalli • Edited

Another awesome feature of DNS is the ability to specify a wildcard (*) as the subdomain.

I use this configured with nginx running as a reverse proxy on my server, so it can direct a request depending on the subdomain the request was sent to. This allows me to dynamically generate new subdomains and I don't have to constantly update the domain records.

For example:
xyz.dragdrop.site goes to files served from the /var/www/static/xyz folder
abc.dragdrop.site goes to files served from the /var/www/static/abc folder
dragdrop.site goes to the NodeJS app running on port 8080
but all of these are guided by the same wildcard CNAME rule.

It's useful to have sites on separate subdomains because they have their own root address space for file references.

Collapse
 
krushndayshmookh profile image
Krushn Dayshmookh

Can you please point me to resource on how to do it?

Collapse
 
flaque profile image
Evan

That is wicked cool.

Collapse
 
alberts profile image
Albert Strasheim

Nice writeup. You might also enjoy this cool little feature that Cloudflare built many years ago: blog.cloudflare.com/introducing-cn...

Collapse
 
flaque profile image
Evan

That is super super cool!

Collapse
 
maestromac profile image
Mac Siri

What a great post and love those images!