How can I validate that a domain name conforms to RFC 1035 using Python?
问题 I'm trying to write some code that will take in a "supposed" domain name and will validate it according to RFC 1035. For instance, it would need to satisfy these rules: Domain consists of no more than 253 total characters Domain character set is [a-z0-9\-] only (will lower case the domain on input) Domain cannot contain two consecutive dashes (eg: google--com.com ) There is a maximum subdomain limit of 127 I have searched for various Python modules (eg: tldextract) but to no avail. How can I