Subdomain in a rails app not working on Fly

I have deployed a rails app with Fly with a custom domain. The site has a landing page: quickvoicestaging.co.za, then it has a subdomain: app.quickvoicestaging.co.za.

The landing page works but I cannot access the subdomain. I swear I was able to access it after playing around with some config settings in rails, namely:
config.action_dispatch.tld_length = 2 and also adding the host names to config.hosts.

I then made some other unrelated changes and after I deployed again it stopped working. So I checked out the previous commit and deployed it, but it doesn’t work anymore. I have no idea what changed. The site works locally

I have a verified wild card certificate and root domain certificate. I have A records pointing to the root domain and the wildcard domain, and an acme challenge CNAME record.

If I run a cert check on the wildcard, it says it has been issued:

The certificate for *.quickvoicestaging.co.za has been issued.
Hostname                  = *.quickvoicestaging.co.za

DNS Provider              = godaddy

Certificate Authority     = Let's Encrypt

Issued                    = rsa,ecdsa

Added to App              = 4 hours ago

Source                    = fly

The error I get when going to the subdomain:

Check if there is a typo in app.quickvoicestaging.co.za.
DNS_PROBE_FINISHED_NXDOMAIN

Does anyone have any ideas?

Hi!

Using dig shows that there’s no DNS entries for the app subdomain

ipv4:

$ dig a quickvoicestaging.co.za

quickvoicestaging.co.za. 600	IN	A	137.66.39.137
quickvoicestaging.co.za. 600	IN	A	66.241.125.176
$ dig a app.quickvoicestaging.co.za

# No entries

ipv6

$ dig aaaa quickvoicestaging.co.za

quickvoicestaging.co.za. 600	IN	AAAA	2a09:8280:1::1:c1c5
$ dig aaaa app.quickvoicestaging.co.za

# No entries

Additional test:

$ host app.quickvoicestaging.co.za

# no resolved hostname

It looks like the app subdomain needs an entry in the DNS setup for that domain? (I don’t see evidence of a catch-all DNS route being used for subdomains, but let me know if I’m incorrect!).

Thank you!! Sorry DNS configs are not my strong suit. I had a @ instead of a * in my A record for the wildcard :see_no_evil: The subdomain seems to be working now.

1 Like

No worries, glad you got that working!