diff options
Diffstat (limited to 'perl-install/network/network.pm')
-rw-r--r-- | perl-install/network/network.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 1594aba32..55d5c324b 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -221,6 +221,11 @@ sub is_ip { return if grep { $_ < 0 || $_ > 255 } @fields; @fields; } +sub is_domain_name { + my ($name) = @_; + my @fields = split /\./, $name; + $name !~ /\.$/ && @fields > 0 && @fields == grep { /^[[:alnum:]](?:[\-[:alnum:]]{0,61}[[:alnum:]])?$/ } @fields; +} sub netmask { my ($ip) = @_; |