Welcome to WebmasterWorld Guest from

Forum Moderators: buckworks & webwork

Message Too Old, No Replies

how to extract tld part from a fqdn?

12:03 pm on Mar 21, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 19, 2002
votes: 0

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?
5:15 pm on Mar 21, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Aug 30, 2002
votes: 24

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 [1], 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.

[1] My main work involves publishing stats reports on the domains hosted on each hoster every month.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members