managing dns subdomains on fly

I’d like to deploy a new fleet of fly applications for each PR I have open on GitHub. These will be set up and torn down via GitHub actions.

I’d like to have a per-PR parent domain like and hang everything off it. So if I have www and api apps, I’d expect them to be available at and, respectively.

I know how to do this using Terraform and Route 53, but that combo is way too 2020 for this project. If possible I’d like to do this completely within fly.

A few questions:

  1. Can I have fly manage the entire DNS zone?
  2. If so, what nameservers should I set with my registrar?
  3. How do I set up and tear down the PR-specific “subdomain” using flyctl (or the GraphQL API)?
  4. How do I bind the www application to (again using flyctl or the GraphQL API)?

The fly domains and fly dns-records commands are probably what you want. These are very beta, but they might have what you need. The big limitation is DNS records – our CLI won’t do individual DNS records, it just imports entire zone files. So you’d have to somehow manage a zone file to make this work with DNS.

If I were you, I’d do this with a proxy and some wildcard domains. You could create PR apps with a naming and

Then a proxy app that knows how to map a subdomain to a fly app name:

  • pr15.www-pr.bazbar →
  • pr15.api-pr.bazbar →

Then you can add wildcard certificates to the proxy app (* and * This could be simpler than DNS shenanigans.