diff --git a/rzonegen.py b/rzonegen.py index 72f8351..f3759dc 100755 --- a/rzonegen.py +++ b/rzonegen.py @@ -12,7 +12,7 @@ def str_to_domainlabel(s): label = re.sub("^-*", "", label) label = re.sub("-*$", "", label) - if not re.match("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$", label): + if not re.match("^[a-zA-Z][a-zA-Z0-9-]{,61}[a-zA-Z0-9]$", label): raise RuntimeError("Not convertable to a domain label: %s" % s) return label diff --git a/zonegen.py b/zonegen.py index 0573c2f..3184871 100755 --- a/zonegen.py +++ b/zonegen.py @@ -12,7 +12,7 @@ def str_to_domainlabel(s): label = re.sub("^-*", "", label) label = re.sub("-*$", "", label) - if not re.match("^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$", label): + if not re.match("^[a-zA-Z][a-zA-Z0-9-]{,61}[a-zA-Z0-9]$", label): raise RuntimeError("Not convertable to a domain label: %s" % s) return label