--- Smokeping.pm.orig	Fri Apr 26 23:14:00 2002
+++ Smokeping.pm	Mon Apr 29 01:39:59 2002
@@ -12,9 +12,15 @@
 use RRDs;
 
 # globale persistent variables for speedy
-use vars qw($cfg $probes $VERSION);
+use vars qw($cfg $probes $VERSION $havegetaddrinfo);
 $VERSION="1.8";
 
+BEGIN {
+  $havegetaddrinfo = 0;
+  eval 'use Socket6';
+  $havegetaddrinfo = 1 unless $@;
+}
+
 
 sub load_probes ($){
     my $cfg = shift;
@@ -689,10 +695,20 @@
 	_sub => sub {
 	    for ( shift ) {
 		m|^DYNAMIC| && return undef;
-		/^\d+\.\d+\.\d+\.\d+$/ && return undef;
+		/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ && return undef;
+		/^[0-9a-f]{0,4}(\:[0-9a-f]{0,4}){0,6}\:[0-9a-f]{0,4}$/i && return undef;
+		if ($havegetaddrinfo) {
+		  my @ai;
+		  @ai = getaddrinfo( $_, "" );
+		  if (scalar(@ai) <= 5) {
+# do not bomb, as this could be temporary
+		    warn "WARNING: Hostname '$_' does currently not resolve to an IP address (@ai)\n";
+		  }
+		} else {
 # do not bomb, as this could be temporary
-		warn "WARNING: Hostname '$_' does currently not resolve to an IP address\n"
-		  unless gethostbyname( $_ );
+		  warn "WARNING: Hostname '$_' does currently not resolve to an IP address\n"
+		    unless gethostbyname( $_ );
+		}
                 return undef;
 	    }
 	    return undef;
