Using an ALIAS record to point an apex domain to a Netlify subdomain (external DNS provider)

Questions:

  • Can an ALIAS record (without any A record) be used with an apex domain to point to the Netlify subdomain (e.g. my-site.netlify.app), rather than pointing the apex domain to the Netlify load balancers? I am asking this for the case where we would like to keep our current external DNS provider, which is not one of the recommended providers in the Netlify docs (NS1, Cloudflare).
  • If so, would this then utilize the higher Netlify CDN speeds when sending requests to the apex domain (rather than the slower CDN speed when pointing to the load balancers and having to go through a redirect to the www subdomain)?
  • Finally, would changing the Netlify primary domain to be the apex domain affect this behavior?

More Information:

site name: TBD
custom domain: datascijedi.org (or www.datascijedi.org)

I am looking into using an external DNS Provider with Netlify web hosting. I read in the Netlify docs that the recommended setup is to use (1) www as the Netlify primary domain, (2) a CNAME for the www subdomain pointing to the Netlify subdomain, and (3) an ANAME, ALIAS, Flattened CNAME, or A record for the apex domain pointing to the Netlify load balancers. The docs also suggest that the www subdomain should be set as the Netlfy primary domain to take advantage of Netlify’s higher CDN speeds.

However, it is not clear to me why the recommendation is to use an ALIAS record to point the apex domain to the Netlify load balancers, rather than directly to the Netlify subdomain, and what the CDN speed implication of this might be. This has implications on preferring use of the apex domain or a www subdomain, so any thoughts on this would be very helpful.

Thank you in advance. a

Hi @raviweb :wave:t6: ,

Welcome to the forums and thanks so much for reaching out! Can you check out [this] support guide? This has some good resources for DNS providers for Alias/ANAME support.

Please note that you can ONLY do this safely with apex-loadbalancer.netlify.com which points to both of our load balancer addresses which is geo distributed only for one provider but you get good performance from anywhere.

Hi @SamO - thanks for the link, very helpful information.

I am still going through the provided support guide, but it would be helpful to clarify why the ALIAS record must be used with apex-loadbalancer.netlify.com, rather than the Netlify subdomain.

For instance, let us assume (1) external DNS is being used, (2) ALIAS and CNAME records point both the apex and www subdomain respectively to the Netlify subdomain, my-site.netlify.app. Consider the following two possible request-response flows for going to the website’s home page:

Flow 1 - GET www.datascijedi.org /

  1. [Browser] GET www.datascijedi.org /
  2. [DNS Server] CNAME my-site.netlify.app
  3. [Browser] Direct GET request to my-site.netlify.app
  4. [Netlify] Netlify/NS1 internal stuff
  5. [Netlify] HTTP Response for web page

Flow 2 - GET datascijedi.org /

  1. [Browser] GET datascijedi.org /
  2. [DNS Server] ALIAS my-site.netlify.app
  3. [Browser] Direct GET request to my-site.netlify.app
    …now, why wouldn’t step 4 and 5 be the same from here?

Thanks again for your help with sorting this out!