rfc1035

How can I validate that a domain name conforms to RFC 1035 using Python?

若如初见. 提交于 2019-12-12 08:28:19
问题 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

How can I validate that a domain name conforms to RFC 1035 using Python?

坚强是说给别人听的谎言 提交于 2019-12-04 02:47:45
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 validate that a domain name conforms to RFC 1035? KISS: import string VALID_CHARS = string.lowercase +

What is the maximum length of a DNS name

让人想犯罪 __ 提交于 2019-11-30 03:02:58
I saw several mentions that the maximum string length of a DNS name (domain name) is 253 characters. Wikipedia seems to be referring this old blog post: https://en.wikipedia.org/wiki/Hostname http://blogs.msdn.com/b/oldnewthing/archive/2012/04/12/10292868.aspx On the other hand, if I understood the RFC, this article is wrong. DNS name maximum string length should be 250 ASCII characters instead of 253 based on the following byte sequence which as per RFC1035 is maxed to 255 bytes: To simplify implementations, the total length of a domain name (i.e., label octets and label length octets) is

What is the maximum length of a DNS name

心不动则不痛 提交于 2019-11-29 00:06:24
问题 I saw several mentions that the maximum string length of a DNS name (domain name) is 253 characters. Wikipedia seems to be referring this old blog post: https://en.wikipedia.org/wiki/Hostname http://blogs.msdn.com/b/oldnewthing/archive/2012/04/12/10292868.aspx On the other hand, if I understood the RFC, this article is wrong. DNS name maximum string length should be 250 ASCII characters instead of 253 based on the following byte sequence which as per RFC1035 is maxed to 255 bytes: To simplify