Change your SharePoint domain name
Unfortunately, it isn't possible to change the SharePoint domain name for your organization in Microsoft 365. For example, if the name of your organization changes from "Contoso" to "Fabrikam," you can't change
To use the domain name
fabrikam.sharepoint.com, you would need to purchase a new Microsoft 365 subscription and move all email, files, and any other data you want to keep to the new subscription.
To change the address of a site, for example, from
https://contoso.sharepoint.com/sites/sample2, you can use the new SharePoint admin center. For info, see Change a site address.