Index: gstat/cmdline.h
===================================================================
--- gstat/cmdline.h	(revision 740)
+++ gstat/cmdline.h	(working copy)
@@ -29,6 +29,7 @@
   int mpifile_flag;	/* Print a load-balanced mpifile (default=off).  */
   int single_line_flag;	/* Print host and information all on one line (default=off).  */
   int list_flag;	/* Print ONLY the host list (default=off).  */
+  int numeric_flag;     /* Print numeric addresses instead of hostnames (default=off). */
   char * gmond_ip_arg;	/* Specify the ip address of the gmond to query (default='localhost').  */
   int gmond_port_arg;	/* Specify the gmond port to query (default='8649').  */
 
@@ -39,6 +40,7 @@
   int mpifile_given ;	/* Whether mpifile was given.  */
   int single_line_given ;	/* Whether single_line was given.  */
   int list_given ;	/* Whether list was given.  */
+  int numeric_given ;	/* Whether numeric was given.  */
   int gmond_ip_given ;	/* Whether gmond_ip was given.  */
   int gmond_port_given ;	/* Whether gmond_port was given.  */
 
Index: gstat/gstat.c
===================================================================
--- gstat/gstat.c	(revision 740)
+++ gstat/gstat.c	(working copy)
@@ -53,7 +53,7 @@
          for( ; li != NULL; li = li->next )
             {
                host = li->val;
-               if( host->name_resolved )
+               if( host->name_resolved && ! args_info.numeric_flag )
                   {
                      if(!strcmp(host->domain, "unspecified"))
                         printf("%s:%d\n", host->name, host->cpu_num);
@@ -130,7 +130,7 @@
    for(; li != NULL; li = li->next)
       {
          host = li->val;
-         if( host->name_resolved )
+         if( host->name_resolved && ! args_info.numeric_flag )
                   {
                      if(!strcmp(host->domain, "unspecified"))
                         printf("%s", host->name);
Index: gstat/cmdline.sh
===================================================================
--- gstat/cmdline.sh	(revision 740)
+++ gstat/cmdline.sh	(working copy)
@@ -10,7 +10,8 @@
 option "dead" d "Print only the hosts which are dead" flag off
 option "mpifile" m "Print a load-balanced mpifile" flag off
 option "single_line" 1 "Print host and information all on one line" flag off
-option "list" l  "Print ONLY the host list" flag off
+option "list" l "Print ONLY the host list" flag off
+option "numeric" n "Print numeric addresses instead of hostnames" flag off
 option "gmond_ip" i "Specify the ip address of the gmond to query" string default="localhost" no
 option "gmond_port" p "Specify the gmond port to query" int default="8649" no
 
Index: gstat/cmdline.c
===================================================================
--- gstat/cmdline.c	(revision 740)
+++ gstat/cmdline.c	(working copy)
@@ -47,6 +47,7 @@
   printf("  -m, --mpifile          Print a load-balanced mpifile  (default=off)\n");
   printf("  -1, --single_line      Print host and information all on one line  (default=\n                           off)\n");
   printf("  -l, --list             Print ONLY the host list  (default=off)\n");
+  printf("  -n, --numeric          Print numeric addresses instead of hostnames (default=off)\n");
   printf("  -i, --gmond_ip=STRING  Specify the ip address of the gmond to query  \n                           (default=`localhost')\n");
   printf("  -p, --gmond_port=INT   Specify the gmond port to query  (default=`8649')\n");
 }
@@ -79,6 +80,7 @@
   args_info->mpifile_given = 0 ;
   args_info->single_line_given = 0 ;
   args_info->list_given = 0 ;
+  args_info->numeric_given = 0 ;
   args_info->gmond_ip_given = 0 ;
   args_info->gmond_port_given = 0 ;
 #define clear_args() { \
@@ -87,6 +89,7 @@
   args_info->mpifile_flag = 0;\
   args_info->single_line_flag = 0;\
   args_info->list_flag = 0;\
+  args_info->numeric_flag = 0;\
   args_info->gmond_ip_arg = gengetopt_strdup("localhost") ;\
   args_info->gmond_port_arg = 8649 ;\
 }
@@ -111,13 +114,14 @@
         { "mpifile",	0, NULL, 'm' },
         { "single_line",	0, NULL, '1' },
         { "list",	0, NULL, 'l' },
+        { "numeric",	0, NULL, 'n' },
         { "gmond_ip",	1, NULL, 'i' },
         { "gmond_port",	1, NULL, 'p' },
         { NULL,	0, NULL, 0 }
       };
 
       stop_char = 0;
-      c = getopt_long (argc, argv, "hVadm1li:p:", long_options, &option_index);
+      c = getopt_long (argc, argv, "hVadm1lni:p:", long_options, &option_index);
 
       if (c == -1) break;	/* Exit from `while (1)' loop.  */
 
@@ -188,6 +192,17 @@
           args_info->list_flag = !(args_info->list_flag);
           break;
 
+        case 'n':	/* Print numeric addresses instead of hostnames.  */
+          if (args_info->numeric_given)
+            {
+              fprintf (stderr, "%s: `--numeric' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE);
+              clear_args ();
+              exit (EXIT_FAILURE);
+            }
+          args_info->numeric_given = 1;
+          args_info->numeric_flag = !(args_info->numeric_flag);
+          break;
+
         case 'i':	/* Specify the ip address of the gmond to query.  */
           if (args_info->gmond_ip_given)
             {
