schappy.de - » www » schappy » de

Description: parked

parked (94)

Example domain paragraphs

Issue: Perl’s Net::Domain functions report full-qualified hostname incorrectly, containing domain name twice. At the same time, the output of hostname -s (just <hosname>) and hostname -f (<hostname>.<domainname> without any duplication) are working correctly. Systems tested: Debian 11 and 12.

Solution: Please check the content of /etc/hostname , which is typically set once during system setup. It is mandatory to contain just the hostname without the domain suffix (not the FQDN) to work correctly with perl’s Net::Domain implementation. The system’s hostname is typically automatically set during boot sequence, e.g. by /etc/init.d/hostname.sh , which reads contents from /etc/hostname . After changing the content of /etc/hostname you might either run /etc/init.d/hostname.sh or just sth. like sudo ho

--- Net::Domain.pm 2023-07-03 12:12:03.457201483 +0200 +++ Net::Domain.pm.new 2023-07-03 12:12:53.331898622 +0200 @@ -106,6 +106,7 @@ $host =~ s/[\0\r\n]+//go; $host =~ s/(\A\.+|\.+\Z)//go; $host =~ s/\.\.+/\./go; + $host =~ s/([^\.]+)\..+/\1/go;

Links to schappy.de (2)