@Test
  public void testRegionServerHostnameReportedToMaster() throws Exception {
    TEST_UTIL.getConfiguration()
      .setBoolean(HRegionServer.UNSAFE_RS_HOSTNAME_DISABLE_MASTER_REVERSEDNS_KEY, true);
    StartTestingClusterOption option = StartTestingClusterOption.builder().numMasters(NUM_MASTERS)
      .numRegionServers(NUM_RS).numDataNodes(NUM_RS).build();
    TEST_UTIL.startMiniCluster(option);
    int expectedRS = NUM_RS;
    try (ZKWatcher zkw = TEST_UTIL.getZooKeeperWatcher()) {
      List<String> servers = ZKUtil.listChildrenNoWatch(zkw, zkw.getZNodePaths().rsZNode);
      assertEquals(expectedRS, servers.size());
    }
  }
Tests for the hostname specification by region server
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java