@Test
  public void testInvalidRegionServerHostnameAbortsServer() throws Exception {
    String invalidHostname = "hostAddr.invalid";
    TEST_UTIL.getConfiguration().set(DNS.UNSAFE_RS_HOSTNAME_KEY, invalidHostname);
    HRegionServer hrs = null;
    try {
      hrs = new HRegionServer(TEST_UTIL.getConfiguration());
    } catch (IllegalArgumentException iae) {
      assertTrue(iae.getMessage(), iae.getMessage().contains("Failed resolve of " + invalidHostname)
        || iae.getMessage().contains("Problem binding to " + invalidHostname));
    }
    assertNull("Failed to validate against invalid hostname", hrs);
  }
Tests for the hostname specification by region server
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerHostname.java