Get-WmiObject Win32_ComputerSystem -ComputerName 'MyCnameRecord' gives error:
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA).
Get-WmiObject Win32_ComputerSystem -ComputerName 'ServerNameToWhichTheAboveCnameRefers' all works.
Get-WmiObject Win32_ComputerSystem -ComputerName 'IPOfServerWhichCnameAlsoCorrectlyResolvesTo' works.
Is anyone aware of some configuration / security setting which may be required to allow RPC calls to a server via a CNAME record? I'd assumed that as the IP is correctly resolving, and this works by IP, it should work by cname record; however clearly it doesn't.
We recently migrated our SQL Servers from a physical cluster to a stand-alone VM. We'd used a DNS alias for the cluster, which we kept after migrating to the VM in order to minimise reconfiguration (i.e. we use this approach: https://www.mssqltips.com/sqlservertip/2663/using-friendly-names-for-sql-servers-via-dns/).
After this migration, some of our monitoring software began giving errors when attempting to query the database server's performance. It was accessing the database server via the DNS alias, rather than by the server name (this had worked previously for the cluster; though no longer worked when using the DNS CNAME record).
The PowerShell code above is just a simplified way to demonstrate the underlying issue.