--- check_by_ssh.c	2006-01-31 10:15:58.805857857 -0400
+++ check_by_ssh.dr.c	2006-01-31 10:15:49.061379743 -0400
@@ -36,6 +36,7 @@
 int commands = 0;
 int services = 0;
 int skip = 0;
+int getnoaddrinfo = 0;
 char *remotecmd = NULL;
 char *comm = NULL;
 char *hostname = NULL;
@@ -139,6 +140,7 @@
 		{"verbose", no_argument, 0, 'v'},
 		{"fork", no_argument, 0, 'f'},
 		{"timeout", required_argument, 0, 't'},
+		{"getnoaddrinfo", no_argument, 0, 'g'},
 		{"host", required_argument, 0, 'H'},
 		{"port", required_argument,0,'p'},
 		{"output", required_argument, 0, 'O'},
@@ -164,7 +166,7 @@
 			strcpy (argv[c], "-t");
 
 	while (1) {
-		c = getopt_long (argc, argv, "Vvh1246ft:H:O:p:i:u:l:C:S:n:s:", longopts,
+		c = getopt_long (argc, argv, "Vvh1246fgt:H:O:p:i:u:l:C:S:n:s:", longopts,
 		                 &option);
 
 		if (c == -1 || c == EOF)
@@ -187,7 +189,6 @@
 				timeout_interval = atoi (optarg);
 			break;
 		case 'H':									/* host */
-			host_or_die(optarg);
 			hostname = optarg;
 			break;
 		case 'p': /* port number */
@@ -228,6 +229,9 @@
 		case 'f':									/* fork to background */
 			asprintf (&comm, "%s -%c", comm, c);
 			break;
+		case 'g':                                                                       /* suppress host lookup */
+		        getnoaddrinfo = 1;
+			break;
 		case 'C':									/* Command for remote machine */
 			commands++;
 			if (commands > 1)
@@ -250,9 +254,10 @@
 		if (c <= argc) {
 			die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname);
 		}
-		host_or_die(argv[c]);
 		hostname = argv[c++];
 	}
+	if (!getnoaddrinfo)
+	  host_or_die(hostname);
 
 	if (strlen(remotecmd) == 0) {
 		for (; c < argc; c++)
@@ -317,7 +322,9 @@
  -S, --skiplines=n\n\
     Ignore first n lines on STDERR (to suppress a logon banner)\n\
  -f\n\
-    tells ssh to fork rather than create a tty\n"));
+    tells ssh to fork rather than create a tty\n\
+ -g, --getnoaddrinfo\n\
+    do not lookup hostname\n"));
 
 	printf (_("\
  -C, --command='COMMAND STRING'\n\
