summaryrefslogtreecommitdiff
path: root/lib/Net/Domain.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net/Domain.pm')
-rw-r--r--lib/Net/Domain.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Net/Domain.pm b/lib/Net/Domain.pm
index c213ce98e2..40ad2a8c9c 100644
--- a/lib/Net/Domain.pm
+++ b/lib/Net/Domain.pm
@@ -16,7 +16,7 @@ use Net::Config;
@ISA = qw(Exporter);
@EXPORT_OK = qw(hostname hostdomain hostfqdn domainname);
-$VERSION = "2.18"; # $Id: //depot/libnet/Net/Domain.pm#20 $
+$VERSION = "2.19"; # $Id: //depot/libnet/Net/Domain.pm#21 $
my($host,$domain,$fqdn) = (undef,undef,undef);
@@ -174,9 +174,10 @@ sub _hostdomain {
if(defined $dom) {
my @h = ();
+ $dom =~ s/^\.+//;
while(length($dom)) {
push(@h, "$host.$dom");
- $dom =~ s/^[^.]+.//;
+ $dom =~ s/^[^.]+.+// or last;
}
unshift(@hosts,@h);
}
@@ -336,6 +337,6 @@ it under the same terms as Perl itself.
=for html <hr>
-I<$Id: //depot/libnet/Net/Domain.pm#20 $>
+I<$Id: //depot/libnet/Net/Domain.pm#21 $>
=cut