in reply to Resolving DNS of local network

Net::Domain provides the hostdomain which seems to be what you are looking for:

#!/usr/bin/perl use strict; use warnings; use feature 'say'; use Net::Domain qw(hostdomain); say hostdomain;

Replies are listed 'Best First'.
Re^2: Resolving DNS of local network
by IB2017 (Pilgrim) on Jan 23, 2018 at 10:52 UTC

    Perfect!

      Glad it was of help, I also should have mentioned it's been a core module for a long time.

      > corelist Net::Domain Net::Domain was first released with perl v5.7.3 > perldoc perlhist | grep 5.7.3 | head -1 5.7.3 2002-Mar-05`