Have you tried the solutions provided in this document: https://learn.microsoft.com/en-us/entra/fundamentals/add-custom-domain
Don't forget to edit the DNS records of your domain on the domain provider's Domain Management Portal as well (as explained in the documentation mentioned above). And the synchronization may also takes a while.
Hope that it helps!