diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 6f65ea2e2..ce6c82985 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; } }