DNS setup question

I have just deployed my first fly app. I have it setup with my own domain such that I access it with:
api.example.com

I have done this with a CNAME DNS entry in my domain registrar, but this isn’t ideal for efficiency. My questions:

  1. Should I add a ‘AAAA’ record pointing to the IPv6 address shown under ‘fly ip list’ ? Since this IP is dedicated, I can count on it reliably? Is this sufficient?
  2. If I do the above, then is adding a ‘A’ record essentially ‘obsolete’?
  3. I added a certificate for api.example.com and then fly prompted me to also add a certificate for www.api.example.com. Whats the point of that?

Thanks for your patience and guidance. It is my first time working with this and I am still learning as I go!

Should I add a ‘AAAA’ record pointing to the IPv6 address shown under ‘fly ip list’ ?

You can do. It will mean if people have ipv6 enabled internet, they will get the ipv6 site.

I can count on it reliably? Is this sufficient?

I’ve not ever had any issues with their IP address

If I do the above, then is adding a ‘A’ record essentially ‘obsolete’?

No, I would have either the cname and AAAA, or A and AAAA records going. It gives more options for your users

I added a certificate for api.example.com and then fly prompted me to also add a certificate for www.api.example.com. Whats the point of that?

The certificate is issued to exactly api.example.com meaning if you have www.api.example.com then you wont get SSL, as the certificate is only issues to api.example.com

If you’re running an API, then there is very little need to offer a www. record. For the most part, we now omit www. from URL’s

Hope this helps

Hey,

We have docs for setting up an external domain here.

With a modern upstream DNS provider, you shouldn’t see any significant difference in performance between A/AAAA and CNAME. Even with the extra lookup, both DNS clients and servers cache lookup results, so most of the time A and CNAME are the same thing.

If you choose not to use CNAME, you should be aware that the IP addresses provided to your machines are not static and may change in the future. You would also need to add both A and AAAA records.

As for the www subdomain, this is mostly a relic of an older web, it’s commonly used “best practice” to treat www. the same as the apex domain. Most modern browsers have magic to make this work even if you don’t set www up.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.