diff --git a/fhem/CHANGED b/fhem/CHANGED
index f1462b6b9..63398d1fb 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - feature: global dnsHostsFile attribute added (Forum #78025)
- feature: 98_DOIFtools: add getter hsvColorGradient, returns a table of
value, colornumber, RGB values and color bar using Color::hsv2rgb
- new: 46_TeslaPowerwall2AC: retrieves data from a Tesla Powerwall 2AC
diff --git a/fhem/FHEM/HttpUtils.pm b/fhem/FHEM/HttpUtils.pm
index 5457adf8a..820da7a04 100644
--- a/fhem/FHEM/HttpUtils.pm
+++ b/fhem/FHEM/HttpUtils.pm
@@ -214,6 +214,24 @@ HttpUtils_gethostbyname($$$$)
if($HU_dnsCache{$host} &&
$HU_dnsCache{$host}{TS}+$HU_dnsCache{$host}{TTL} > gettimeofday());
+ my $dh = AttrVal("global", "dnsHostsFile", "undef");
+ if($dh) {
+ my $fh;
+ if(open($fh, $dh)) {
+ while(my $line = <$fh>) {
+ if($line =~ m/^([^# \t]+).*\b\Q$host\E\b/) {
+ if($1 =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ && # IP-Address
+ $1<256 && $2<256 && $3<256 && $4<256) {
+ $fn->($hash, undef, pack("CCCC", $1, $2, $3, $4));
+ close($fh);
+ return;
+ }
+ }
+ }
+ close($fh);
+ }
+ }
+
# Direct DNS Query via UDP
my $c = IO::Socket::INET->new(Proto=>'udp', PeerAddr=>"$dnsServer:53");
return $fn->($hash, "Cant create UDP socket:$!", undef) if(!$c);
diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html
index b87a097f4..5b7559d1f 100644
--- a/fhem/docs/commandref_frame.html
+++ b/fhem/docs/commandref_frame.html
@@ -1428,6 +1428,13 @@ The following local attributes are used by a wider range of devices:
dynamically.
+
+