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
This is not possible without a up-to-date database of different domain levels.
Consider:
s1.moh.gov.cn
moh.gov.cn
s1.google.com
google.com
Then at which level you want to get the domain? It's completely depends of the TLD, SLD, ccTLD... because ccTLD in under control of countries they may define very special SLD which is unknown to you.