diff --git a/NEWS b/NEWS
index 3e2e324c314317ddd0abb72141eb06c6e3820c6f..8c8f4e22ecbe62c49976948bc2c86c1dccb6d616 100644
--- a/NEWS
+++ b/NEWS
@@ -82,6 +82,7 @@ documents those changes that are of interest to users and administrators.
  -- Restore GRES functionality with select/linear plugin. It was broken in
     version  14.03.10.
  -- Fix bug with GRES having multiple types that can cause slurmctld abort.
+ -- Fix squeue issue with not recognizing "localhost" in --nodelist option.
 
 * Changes in Slurm 14.11.1
 ==========================
diff --git a/src/squeue/opts.c b/src/squeue/opts.c
index 6430dc96ef7b6faa699b7c92e814c07c9db6c929..9dc68db8f2dcf14ad6bdf223e66e9e6225503bf9 100644
--- a/src/squeue/opts.c
+++ b/src/squeue/opts.c
@@ -87,7 +87,7 @@ static void _parse_long_token( char *token, char *sep, int *field_size,
 			       bool *right_justify, char **suffix);
 static void  _print_options( void );
 static void  _usage( void );
-static bool _check_node_names(char *);
+static bool _check_node_names(hostset_t);
 static bool _find_a_host(char *, node_info_msg_t *);
 
 /*
@@ -97,7 +97,6 @@ extern void
 parse_command_line( int argc, char* argv[] )
 {
 	char *env_val = NULL;
-	char *nodes;
 	bool override_format_env = false;
 	int opt_char;
 	int option_index;
@@ -151,7 +150,6 @@ parse_command_line( int argc, char* argv[] )
 	}
 	if (getenv("SQUEUE_PRIORITY"))
 		params.priority_flag = true;
-	nodes = NULL;
 	while ((opt_char = getopt_long(argc, argv,
 				       "A:ahi:j::lL:n:M:O:o:p:Pq:R:rs::S:t:u:U:vVw:",
 				       long_options, &option_index)) != -1) {
@@ -299,7 +297,6 @@ parse_command_line( int argc, char* argv[] )
 				      optarg);
 				exit(1);
 			}
-			nodes = xstrdup(optarg);
 			break;
 		case OPT_LONG_HELP:
 			_help();
@@ -375,17 +372,15 @@ parse_command_line( int argc, char* argv[] )
 			xfree(name2);
 		}
 
-		/* Replace params.nodename with the new one */
+		/* Replace params.nodes with the new one */
 		hostset_destroy(params.nodes);
 		params.nodes = nodenames;
 		/* Check if all node names specified
 		 * with -w are known to the controller.
 		 */
-		if (!_check_node_names(nodes)) {
-			xfree(nodes);
+		if (!_check_node_names(params.nodes)) {
 			exit(1);
 		}
-		xfree(nodes);
 	}
 
 	if ( ( params.accounts == NULL ) &&
@@ -1942,11 +1937,10 @@ Usage: squeue [OPTIONS]\n\
 /* _check_node_names()
  */
 static bool
-_check_node_names(char *names)
+_check_node_names(hostset_t names)
 {
 	int cc;
 	node_info_msg_t *node_info;
-	hostlist_t l;
 	char *host;
 	hostlist_iterator_t itr;
 
@@ -1961,8 +1955,7 @@ _check_node_names(char *names)
 		return false;
 	}
 
-	l = slurm_hostlist_create(names);
-	itr = hostlist_iterator_create(l);
+	itr = hostset_iterator_create(names);
 	while ((host = hostlist_next(itr))) {
 		if (!_find_a_host(host, node_info)) {
 			error("Invalid node name %s", host);