Skip to content

Instantly share code, notes, and snippets.

@evrardjp
Created April 13, 2018 15:01
Show Gist options
  • Save evrardjp/ccd435c68d268caa324649a97bcb3a81 to your computer and use it in GitHub Desktop.
Save evrardjp/ccd435c68d268caa324649a97bcb3a81 to your computer and use it in GitHub Desktop.
def is_valid_name(name=None):
if not Name:
return False
if isinstance(name, str):
return True
def is_valid_hostname(name=None):
if not is_valid_name(name):
return False
if len(name) > 253:
return False
if name.replace('_', '').replace('-', '').isalnum():
return True
return False
@evrardjp
Copy link
Author

is that what you meant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment