This is an in-progress example of a DNS setup for a Rails app that will allow members to claim a subdomain that is hosted on Heroku. Additionally, subdomain owners should have the option to use their own domain that maps to this subdomain.
Heroku has a slightly unique DNS setup, so it seems that some DNS workarounds will be necessary.
- The primary application domain will be example.com
- The registrar is GoDaddy.com
- The member's subdomain within the application is member1
- The member's custom domain is member1.com
Host Points To TTL
* 75.101.163.44 1 Hour
* 75.101.145.87 1 Hour
* 174.129.212.2 1 Hour
*.example.net
Host Points To TTL
@ 75.101.163.44 1 Hour
@ 75.101.145.87 1 Hour
@ 174.129.212.2 1 Hour
Host Points To TTL
www proxy.heroku.com 1 Hour
member1.com
www.member1.com
At this point, member1.com, www.member1.com and member1.example.com should all reach the application.
The Rails application will now be tasked with discerning the subdomain associated with member1.com, www.member1.com and member1.example.com. Initial plans will be to get this subdomain and then use subdomain-fu just as would be done for a normal DNS setup. More to come...