I have written a function that "extract" the domain from hostname. e.g.
www.domain.com -> domain.com
domain.net -> domain.net
www.domain.co.uk -> domain.co.uk
www.subdomain.domain.tx.us -> domain.tx.us
and so on.
However I was unable to find list of all subTDL's.
Function also return wrong result for domains such nominet.uk
Any suggestions where I can find all of them?
Or any other way to do same function, but with using let say DNS?