Getting naked domain redirect loop

I want to serve my site out of the naked/root domain (https://flagsmith.com). I also have https://www.flagsmith.com set up and working in Webflow.

When I set the naked domain as the default domain, I get a redirect loop:

HTTP/2 301
date: Thu, 06 Jul 2023 11:22:29 GMT
content-type: text/html
content-length: 166
location: https://www.flagsmith.com/

HTTP/2 301
date: Thu, 06 Jul 2023 11:22:29 GMT
content-type: text/html
content-length: 166
cache-control: private
content-security-policy: frame-ancestors 'self'
location: https://flagsmith.com/
x-frame-options: SAMEORIGIN
accept-ranges: bytes
x-served-by: cache-iad-kjyo7100064-IAD, cache-dub4322-DUB
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1688642550.806266,VS0,VE136
vary: x-wf-forwarded-proto
x-cluster-name: eu-west-1-prod-hosting-red

HTTP/2 301
date: Thu, 06 Jul 2023 11:22:30 GMT
content-type: text/html
content-length: 166
location: https://www.flagsmith.com/

HTTP/2 301
date: Thu, 06 Jul 2023 11:22:30 GMT
content-type: text/html
content-length: 166
cache-control: private
content-security-policy: frame-ancestors 'self'
location: https://flagsmith.com/
x-frame-options: SAMEORIGIN
accept-ranges: bytes
x-served-by: cache-iad-kcgs7200143-IAD, cache-dub4351-DUB
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1688642550.080698,VS0,VE109
vary: x-wf-forwarded-proto
x-cluster-name: eu-west-1-prod-hosting-red

HTTP/2 301
date: Thu, 06 Jul 2023 11:22:30 GMT
content-type: text/html
content-length: 166
location: https://www.flagsmith.com/

If I set www.flagsmith.com as primary, things work fine and the naked domain redirects to www. Can Webflow be set to work with the naked domain as the primary with www redirecting to it?

Hey Ben on the domain settings screen it has guidance on this.
You can only use the naked domain if your DNS provider supports CNAME flattening, and then you will setup your DNS slightly differently.