Reputation: 11068
Django URLValidator will raise a validation error for this website URL because of the underscore:
http://beauharnois_bupa.tripod.com/
From what I've read some says that it's not a valid domain name, some say it is and the RFCs seems to say that it's legal in the subdomain label but not in the hostname.
My guess is that it is legal in the subdomain label since the website mentioned above works..
Who's right ?
Upvotes: 3
Views: 6253
Reputation: 126
according to Can (hostname) subdomains have an underscore "_" in it? it should be legal.
It is perfectly legal to have an underscore in a domain name. Let me quote the standard, RFC 2181, section 11, "Name syntax":
Upvotes: 4
Reputation: 411132
Underscores are not valid characters, even in subdomains, so it will be marked as invalid. However, some sites that dynamically route requests based on a subdomain component do allow underscores, even though they're technically an invalid character. So you might be able to navigate to the URL, even though it's technically not valid.
RFC 1035 discusses the structure of a domain name.
Upvotes: 4