diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 1020310ba..c17c785e6 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -2188,7 +2188,7 @@ sub isValidHostname my ($class, $hostname) = @_; if ($hostname =~ /^[a-z0-9]/){ if ($hostname =~ /[a-z0-9]$/){ - if ($hostname =~ /[\-a-z0-9]+/){ + if ($hostname =~ /^[\-a-z0-9]+$/){ return 1; } }