I was recently asked by a friend, how to find the names of the nodes that are participating in a failover cluster.
The Dynamic Management View sys.dm_os_cluster_nodes will give this information. The following script will return the list of Node names in the cluster.
Note that the query was run on a 3 Node cluster, so the result set displays the 3 Nodes in the cluster.
If the same command is run on a stand alone machine, it would not return any node name indicating it is not a cluster.
— Bru Medishetty