When creating the A DNS entry on your domain provider, create it under the www subdomain instead of the root.
After that, when running ./discourse-setup
part of the Discourse official Standard Installation pass the domain with the www.
part too.