diff --git a/includes/functions.php b/includes/functions.php index c9a9a2709b..ebd7008b32 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1330,7 +1330,7 @@ function oxidized_reload_nodes() { * @return string ip * **/ -function dnslookup($device,$type=false) { +function dnslookup($device,$type=false,$return=false) { if (filter_var($device['hostname'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) == true || filter_var($device['hostname'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) == truee) { return ''; } @@ -1345,6 +1345,9 @@ function dnslookup($device,$type=false) { $return = 'ip'; } } + if (empty($return)) { + return ''; + } $record = dns_get_record($device['hostname'],$type); return $record[0][$return]; }//end dnslookup