Revert "#767 also respect dns->no configuration in ip_from_hostname()"
This reverts commit 74b9583fae.
This commit is contained in:
1
Changes
1
Changes
@@ -16,7 +16,6 @@
|
||||
* #784 empty device_skip table when also emptying job queue
|
||||
* #788 use device.name instead of device.dns for pseudo devices
|
||||
* #783 fix FQDN discovery in node monitor emails
|
||||
* #767 also respect dns->no configuration in ip_from_hostname()
|
||||
|
||||
2.047005 - 2021-02-24
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@ use Dancer ':script';
|
||||
use Net::DNS;
|
||||
use NetAddr::IP::Lite ':lower';
|
||||
|
||||
use App::Netdisco::Util::Permission 'check_acl_no';
|
||||
|
||||
use base 'Exporter';
|
||||
our @EXPORT = ();
|
||||
our @EXPORT_OK = qw/hostname_from_ip ipv4_from_hostname/;
|
||||
@@ -31,8 +29,6 @@ subroutines.
|
||||
|
||||
Given an IP address (either IPv4 or IPv6), return the canonical hostname.
|
||||
|
||||
Will respect the excluded IPs in L<DNS no> configuration.
|
||||
|
||||
C<< %opts >> can override the various timeouts available in
|
||||
L<Net::DNS::Resolver>:
|
||||
|
||||
@@ -55,11 +51,8 @@ Returns C<undef> if no PTR record exists for the IP.
|
||||
sub hostname_from_ip {
|
||||
my ($ip, $opts) = @_;
|
||||
return unless $ip;
|
||||
my $skip = setting('dns')->{'no'};
|
||||
my $ETCHOSTS = setting('dns')->{'ETCHOSTS'};
|
||||
|
||||
return if check_acl_no($ip, $skip);
|
||||
|
||||
# check /etc/hosts file and short-circuit if found
|
||||
foreach my $name (reverse sort keys %$ETCHOSTS) {
|
||||
if ($ETCHOSTS->{$name}->[0]->[0] eq $ip) {
|
||||
|
||||
Reference in New Issue
Block a user