tld

Top level domain from URL in C#

六月ゝ 毕业季﹏ 提交于 2019-11-26 09:54:01
问题 I am using C# and ASP.NET for this. We receive a lot of \"strange\" requests on our IIS 6.0 servers and I want to log and catalog these by domain. Eg. we get some strange requests like these: http://www.poker.winner4ever.example.com/ http://www.hotgirls.example.com/ http://santaclaus.example.com/ http://m.example.com/ http://wap.example.com/ http://iphone.example.com/ the latter three are kinda obvious, but I would like to sort them all into one as \"example.com\" IS hosted on our servers.

How long can a TLD possibly be?

回眸只為那壹抹淺笑 提交于 2019-11-26 09:29:12
问题 I\'m working on an email validation regex in PHP and I need to know how long the TLD could possibly be and still be valid. I did a few searches but couldn\'t find much information on the topic. So how long can a TLD possibly be? 回答1: DNS allows for a maximum of 63 characters for an individual label. 回答2: The longest TLD currently in existence is 24 characters long, and subject to change. The maximum TLD length specified by RFC 1034 is 63 octets. To get the length of the longest existing TLD: