code: private boolean inHostsList(DatanodeID node, String ipAddr) {
      Set<String> hostsList = hostsReader.getHosts();
      try {
        if (hostsList.isEmpty()
            || (ipAddr != null && hostsList.contains(ipAddr))
            || hostsList.contains(node.getHost())
            || hostsList.contains(node.getName())
            || ((node instanceof DatanodeInfo) && (hostsList.contains(((DatanodeInfo) node)
                .getHostName()) 
            || hostsList.contains(((DatanodeInfo) node).getHostName() + ":"
                + node.getPort()))) 
            // this is for the mixed mode in which the hostnames in the includes file
            // are followed with a "." and the datanodes are using IP addresses
            // during registration
            || (ipAddr != null && 
                hostsList.contains(InetAddress.getByName(ipAddr).getHostName() 
                + "."))) {
          return true;
        }
        
        // for several calls we pass ipAddr = null, but the datanode name
        // is an IP address, for this we need to do best effort reverse DNS 
        // resolution
        String host = getHostNameForIp(node.getHost());
        if (host != null) {
          return hostsList.contains(host + ".") || hostsList.contains(host);
        }
        
        // host is not in the list
        return false;
      } catch (UnknownHostException e) {
        LOG.error(e);
      }
      return false;
    }
docs: Keeps track of which datanodes/ipaddress are allowed to connect to the namenode.