Connect custom domain with a record

I’m trying to connect my domain to a project and I succeeded through the cname record, but I want to connect the domain without subdomain like not
how can i do it?

Some registrars have ANAME and ALIAS records.
If you can see this, you should be able to set it instead of a CNAME record.
Even if that is not possible, you can set it in the A record after checking the IP address.
More details on this page:

I like to use Cloudflare. Cloudflare can set this in a CNAME record.
(It’s a CDN service so there’s a trick. It’s completely free)