diff --git a/jdresolve b/jdresolve
index 4877517..efb16b2 100755
--- a/jdresolve
+++ b/jdresolve
@@ -857,7 +857,12 @@ sub checkresponse {
 				# For each DNS answer, check the data received
 				if ($type eq 'H') {
 					if (defined $_->{ptrdname}) {
+						if ($_->isa('Net::DNS::RR::PTR')) { 
+							# Fix for a new version of Net::DNS 
+							$hosts{$query}{NAME} = $_->rdatastr();
+						} else {
 						$hosts{$query}{NAME} = $_->{ptrdname};
+						}
 						$hosts{$query}{RESOLVED} = 'N';
 
 						$resolved = 1;
