Background
I'm using Heroku's Review Apps feature. It deploys a new app instance for each github pull request opened, and assigns it a unique URL of the format
my-app-pr-1234.myapp.herokuapp.com
My app makes heavy use of subdomains, which Heroku doesn't support (see answer here).
They require that I purchase and set up a DNS record to handle the subdomain, so I purchased example.com
Question
Each pull request will generate it's own unique URL. And I don't want to set up a new DNS record for each, I'd rather set up one generic DNS record.
How do I set up DNS so that it "parses" the subdomain of the incoming request and directs it to the correct app?
Example:
- I visit
foo.pr-1738.example.com
- I'd like DNS to parse out the requested subdomain and point to
my-app-pr-1738.myapp.herokuapp.com
(the subdomainfoo
will be handled by the app itself)
Is this possible?
Side note: I use DNSimple for DNS record management, although this question applies to DNS in general.