%3CLINGO-SUB%20id%3D%22lingo-sub-1217805%22%20slang%3D%22en-US%22%3EHow%20to%20use%20different%20domain%20name%20to%20connect%20to%20Azure%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1217805%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EThere%20are%20couple%20of%20options%20available%20in%20Azure%20SQL%20Server%20if%20customer%20wants%20to%20connect%20with%20different%20name.%20Following%20option%20may%20also%20apply%20when%20customer%20uses%20private%20endpoint.%20This%20article%20applies%20to%20SQL%20DB%20and%20not%20all%20options%20works%20for%20MI.%20%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-1111318731%22%20id%3D%22toc-hId-1111318731%22%20id%3D%22toc-hId-1111318731%22%3E%3CSTRONG%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%26nbsp%3B1.%20DNS%20Alias%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fdns-alias-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fdns-alias-overview%3C%2FA%3E%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fdns-alias-powershell%3Ftabs%3Dazure-powershell%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fdns-alias-powershell%3Ftabs%3Dazure-powershell%3C%2FA%3E%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EAzure%20SQL%20DB%20supports%20DNS%20alias%20as%20you%20can%20see%20in%20above%20doc.%20However%2C%20the%20created%20alias%20will%20not%20be%20the%20domain%20format.%26nbsp%3B%20It%20can%20only%20be%20made%20up%20of%20lowercase%20letters%20'a'-'z'%2C%20the%20numbers%200-9%20and%20the%20hyphen.%20For%20example%2C%20you%20can%20only%20create%20DNS%20alias%20with%20eeoc%20instead%20of%20eeoc.gov.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EWhen%20connecting%2C%20the%20alias%20replaces%20the%20first%20dot-delimited%20node%20in%20the%20four%20node%20server%20string.%20For%20example%2C%20we%20can%20connect%20using%20eeoe.database.windows.net%20for%20my%20original%20server%20yxgri1g2pa.database.windows.net%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EPrivate%20endpoint%20works%20in%20this%20method.%20I%20tested%20with%20user%20as%20username%20and%20username%40servername%20and%20both%20works%20for%20me.%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EThis%20option%20will%20not%20work%20for%20MI.%20%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CH3%20id%3D%22toc-hId--696135732%22%20id%3D%22toc-hId--696135732%22%20id%3D%22toc-hId--696135732%22%3E%3CSTRONG%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E2.%20Host%20file%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CH5%20id%3D%22toc-hId--1802525617%22%20id%3D%22toc-hId--1802525617%22%20id%3D%22toc-hId--1802525617%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EC%3A%5CWindows%5CSystem32%5Cdrivers%5Cetc.%20Edit%20Host%20file%20using%20notepad%3C%2FFONT%3E%3C%2FH5%3E%0A%3CUL%3E%0A%3CLI%3E%3CU%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EConnection%20through%20private%20endpoint%3C%2FFONT%3E%3C%2FU%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EUpdate%20the%20host%20file%20and%20let%20it%20points%20to%20the%20privatelink%20IP.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-03-09%20111413.png%22%20style%3D%22width%3A%20596px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175942i28A3129C092FA545%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-03-09%20111413.png%22%20alt%3D%22Annotation%202020-03-09%20111413.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EHowever%2C%20the%20doc%20says%20it%20is%20only%20recommended%20for%20testing%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fprivate-link%2Fprivate-endpoint-overview%23dns-configuration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fprivate-link%2Fprivate-endpoint-overview%23dns-configuration%3C%2FA%3E%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CUL%3E%0A%3CLI%3E%3CU%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EConnect%20through%20public%20network%3C%2FFONT%3E%3C%2FU%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EUpdate%20the%20host%20file%20and%20let%20it%20points%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-connectivity-architecture%23azure-sql-database-gateway-ip-addresses%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESQL%20Server%20gateway%20IP%3C%2FA%3E.%20You%20can%20also%20get%20the%20gateway%20Ip%20by%20pinging%20the%20server%20name.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EI%20tested%20with%20user%20as%20username%20and%20username%40servername%20and%20both%20works%20for%20me.%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CH3%20id%3D%22toc-hId--16077362%22%20id%3D%22toc-hId--16077362%22%20id%3D%22toc-hId--16077362%22%3E%3CSTRONG%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E3.%20Cliconfg%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CH5%20id%3D%22toc-hId--1122467247%22%20id%3D%22toc-hId--1122467247%22%20id%3D%22toc-hId--1122467247%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%E2%80%9CC%3A%5Cwindows%5Csyswow64%5Ccliconfg.exe%E2%80%9D%20(It%20has%20to%20be%20the%2064bit%20version%20if%20running%20on%2064%20bit%20system.%20If%20you%20are%20using%2032%20bit%20system%2C%20you%20may%20try%20with%2032%20bit%20version%20of%20cliconfg.)%3C%2FFONT%3E%3C%2FH5%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-03-09%2011142.png%22%20style%3D%22width%3A%20590px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175946i65A24FFBDD9D8235%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-03-09%2011142.png%22%20alt%3D%22Annotation%202020-03-09%2011142.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CBR%20%2F%3EIt%20works%20in%20both%20private%20connection%20or%20public%20connections.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EIn%20this%20method%2C%20I%20will%20have%20to%20use%20username%40servername%20to%20connect%3C%2FFONT%3E%3C%2FFONT%3E%3CDIV%20id%3D%22tinyMceEditorDandan_Zhang_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20id%3D%22tinyMceEditorDandan_Zhang_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-03-09%2011.png%22%20style%3D%22width%3A%20475px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175947iA10A1813EF64CF47%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-03-09%2011.png%22%20alt%3D%22Annotation%202020-03-09%2011.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EIf%20I%20only%20put%20the%20username%20without%20the%20servername%2C%20I%20will%20get%20error%20%22Cannot%20open%20server%20%22ece.com%22%20requested%20by%20the%20login.%26nbsp%3B%20The%20login%20failed.%20(Microsoft%20SQL%20Server%2C%20Error%3A%2040532)%22%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-663981008%22%20id%3D%22toc-hId-663981008%22%20id%3D%22toc-hId-663981008%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CSTRONG%3E4.%20CNAME%3C%2FSTRONG%3E%20%3C%2FFONT%3E%3C%2FH3%3E%0A%3CH5%20id%3D%22toc-hId--442408877%22%20id%3D%22toc-hId--442408877%22%20id%3D%22toc-hId--442408877%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EUpdate%20CNAME%20record%20in%20the%20DNS%20server.%20%3CBR%20%2F%3E%26nbsp%3B%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FH5%3E%0A%3CUL%3E%0A%3CLI%3E%3CU%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EConnect%20through%20private%20endpoint%3C%2FFONT%3E%3C%2FU%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EIn%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fprivate-link%2Fprivate-endpoint-overview%23dns-configuration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fprivate-link%2Fprivate-endpoint-overview%23dns-configuration%3C%2FA%3E%2C%20it%20says%20we%20can%20use%20private%20DNS%20zone%20or%20custom%20DNS%20server.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CUL%20class%3D%22lia-list-style-type-circle%22%3E%0A%3CLI%3E%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EUse%20a%20private%20DNS%20zone.%20You%20can%20use%20private%20DNS%20zones%20to%20override%20the%20DNS%20resolution%20for%20a%20given%20private%20endpoint.%20A%20private%20DNS%20zone%20can%20be%20linked%20to%20your%20virtual%20network%20to%20resolve%20specific%20domains.%20%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EUse%20your%20custom%20DNS%20server.%20You%20can%20use%20your%20own%20DNS%20server%20to%20override%20the%20DNS%20resolution%20for%20a%20given%20private%20link%20resource.%20If%20your%20DNS%20server%20is%20hosted%20on%20a%20virtual%20network%2C%20you%20can%20create%20a%20DNS%20forwarding%20rule%20to%20use%20a%20private%20DNS%20zone%20to%20simplify%20the%20configuration%20for%20all%20private%20link%20resources.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EWith%20private%20DNS%20zone%2C%20steps%20are%3A%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E1.%20Create%20new%20private%20DNS%20zone.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E2.%20Link%20VNET%20that%20the%20private%20endpoint%20belongs%20to.%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E3.%20Add%20CNAME%20record%20to%20yxgri1g2pa.privatelink.database.windows.net%20or%20yxgri1g2pa.database.windows.net%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E4.%20Once%20this%20is%20done%2C%20I%20am%20able%20to%20connect%20to%20sql%20(I%20have%20to%20use%20username%40servername%20to%20login.%20Failed%20to%20connect%20without%20using%20%40servername)%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-03-09%20111415.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175941i13FD515E38B721AD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-03-09%20111415.png%22%20alt%3D%22Annotation%202020-03-09%20111415.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-03-09%20111417.png%22%20style%3D%22width%3A%20476px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F175940iFD50E6F06FB5CC04%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-03-09%20111417.png%22%20alt%3D%22Annotation%202020-03-09%20111417.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3ECustomer%20should%20also%20be%20able%20to%20use%20their%20own%20DNS%20server%20to%20update%20the%20CNAME%20NAME.%20But%20I%20have%20not%20tested%20this%20solution.%20%3C%2FFONT%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EUsing%20DNS%20server%20to%20update%20CNAME%20should%20work%20for%20%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3Epublic%20connections%20too.%3C%2FFONT%3E%3CBR%20%2F%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1224616%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20different%20domain%20name%20to%20connect%20to%20Azure%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1224616%22%20slang%3D%22en-US%22%3E%3CP%3ECan%20you%20please%20specify%20which%20options%20will%20work%20for%20MI%20and%20if%20there%20are%20any%20extra%20requirements%3F%20For%20example%2C%20using%20CNAME%20we%20found%20that%20we%20need%20to%20add%20the%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22mailto%3Ausername%40servername%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eusername%40servername%3C%2FA%3E%26nbsp%3Bbut%20we%20also%20need%20to%20set%26nbsp%3BTrustServerCertificate%20property%20to%26nbsp%3Btrue%20to%20work.%20This%20property%20seems%20not%20needed%20if%20we%20use%20the%20original%20server%20name.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20a%20planned%20feature%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ffeedback.azure.com%2Fforums%2F915676-sql-managed-instance%2Fsuggestions%2F38016925-support-dns-aliasing-of-an-azure-sql-managed-insta%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ffeedback.azure.com%2Fforums%2F915676-sql-managed-instance%2Fsuggestions%2F38016925-support-dns-aliasing-of-an-azure-sql-managed-insta%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20get%20some%20extra%20info%20about%20the%20status%20of%20this%20feature%3F%20It%20will%20be%20really%20nice%20to%20be%20able%20to%20connect%20just%20with%20a%20CNAME%2FDNS%2FHost%20alias%20using%20a%20loginname%20and%20without%20the%20server%20name.%20This%20will%20help%20a%20lot%20migrations%20to%20MI%20and%20also%20will%20simplify%20DR%20on%20hybrid%20scenarios.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft
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.
 

 1. DNS Alias

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.
Annotation 2020-03-09 111413.png
 
  • Connect through public network
Update the host file and let it points to the SQL Server gateway IP. You can also get the gateway Ip by pinging the server name.
I tested with user as username and username@servername and both works for me.
 

3. Cliconfg

“C:\windows\syswow64\cliconfg.exe” (It has to be the 64bit version if running on 64 bit system. If you are using 32 bit system, you may try with 32 bit version of cliconfg.)
Annotation 2020-03-09 11142.png

It works in both private connection or public connections.
In this method, I will have to use username@servername to connect
 
 

Annotation 2020-03-09 11.png

If I only put the username without the servername, I will get error "Cannot open server "ece.com" requested by the login.  The login failed. (Microsoft SQL Server, Error: 40532)"
 

4. CNAME

Update CNAME record in the DNS server.
 
  • Connect through private endpoint
  • 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)
Annotation 2020-03-09 111415.pngAnnotation 2020-03-09 111417.png
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.
1 Comment
Regular Visitor

Can you please specify which options will work for MI and if there are any extra requirements? For example, using CNAME we found that we need to add the  username@servername but we also need to set TrustServerCertificate property to true to work. This property seems not needed if we use the original server name.

 

There is a planned feature here: https://feedback.azure.com/forums/915676-sql-managed-instance/suggestions/38016925-support-dns-alias...

 

Is it possible to get some extra info about the status of this feature? It will be really nice to be able to connect just with a CNAME/DNS/Host alias using a loginname and without the server name. This will help a lot migrations to MI and also will simplify DR on hybrid scenarios.