diff options
author | Graham Barr <gbarr@pobox.com> | 1999-02-17 15:15:45 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 1999-02-17 15:15:45 +0000 |
commit | 92419eef0b75bd4aead070a5aa2e3176cac79e00 (patch) | |
tree | 8d274f4f74b57f8bb5c342a328fe3ef1f8b3f458 | |
parent | b6abda47ba101483f57ea2313b505811bc3f3799 (diff) | |
download | perl-libnet-92419eef0b75bd4aead070a5aa2e3176cac79e00.tar.gz |
Net::Domain
- set FQDN = IP if host does not have a name
-rw-r--r-- | Net/Domain.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Net/Domain.pm b/Net/Domain.pm index 765bfaa..bbd9ced 100644 --- a/Net/Domain.pm +++ b/Net/Domain.pm @@ -16,7 +16,7 @@ use Net::Config; @ISA = qw(Exporter); @EXPORT_OK = qw(hostname hostdomain hostfqdn domainname); -$VERSION = "2.11"; # $Id: //depot/libnet/Net/Domain.pm#9 $ +$VERSION = "2.12"; # $Id: //depot/libnet/Net/Domain.pm#10 $ my($host,$domain,$fqdn) = (undef,undef,undef); @@ -217,6 +217,9 @@ sub domainname { return $fqdn = $host . "." . $domain if($host !~ /\./ && $domain =~ /\./); + # For hosts that have no name, just an IP address + return $fqdn = $host if $host =~ /^\d+(\.\d+){3}$/; + my @host = split(/\./, $host); my @domain = split(/\./, $domain); my @fqdn = (); |