tld of example.com is .com tld of example.co.uk is .co.uk tld of example.com.cn is .com.cn tld of example.abc.cn is .cn, not abc.cn it seems the browser know it when setting cookie with domain name (reject to save cookie into tld), but what if there's a new tld? how can a browser know it without update/patch? is there any pattern to recognize which part is tld without knowing a list a tld?
Not sure how the browsers do it but a few hundred ccTLDs exist and some of the follow the US system of com.ccTLD/net.ccTLD/org.ccTLD/gov.ccTLD etc. Some follow the British model of .co.ccTLD, .ltd.ccTLD. And others still can have multiple subdomains like .kr or .us. It can get fairly complex after a while. For generating the statistics for each hoster in .com/net/org/biz/info/ie , the first stage is to check the tld at the end of the domain of the nameserver in question and then apply the country code subdomain rules.
Regards...jmcc  My main work involves publishing stats reports on the domains hosted on each hoster every month.