There are couple of options available in Azure SQL Server if customer wants to connect with different name. Following option may also apply when customer uses private endpoint. This article applies to SQL DB and not all options works for MI.
Azure SQL DB supports DNS alias as you can see in above doc. However, the created alias will not be the domain format. It can only be made up of lowercase letters 'a'-'z', the numbers 0-9 and the hyphen. For example, you can only create DNS alias with eeoc instead of eeoc.gov.
When connecting, the alias replaces the first dot-delimited node in the four node server string. For example, we can connect using eeoe.database.windows.net for my original server yxgri1g2pa.database.windows.net
Private endpoint works in this method. I tested with user as username and username@servername and both works for me.
This option will not work for MI.
2. Host file
C:\Windows\System32\drivers\etc. Edit Host file using notepad
Connection through private endpoint
Update the host file and let it points to the privatelink IP.
Use a private DNS zone. You can use private DNS zones to override the DNS resolution for a given private endpoint. A private DNS zone can be linked to your virtual network to resolve specific domains.
Use your custom DNS server. You can use your own DNS server to override the DNS resolution for a given private link resource. If your DNS server is hosted on a virtual network, you can create a DNS forwarding rule to use a private DNS zone to simplify the configuration for all private link resources.
With private DNS zone, steps are:
1. Create new private DNS zone.
2. Link VNET that the private endpoint belongs to.
3. Add CNAME record to yxgri1g2pa.privatelink.database.windows.net or yxgri1g2pa.database.windows.net
4. Once this is done, I am able to connect to sql (I have to use username@servername to login. Failed to connect without using @servername)
Customer should also be able to use their own DNS server to update the CNAME NAME. But I have not tested this solution.
Using DNS server to update CNAME should work for public connections too.