

Public Suffix List - edw519
http://publicsuffix.org/index.html

======
jgrahamc
This is very handy. I use it for the domain parsing on <http://twi.bz> because
it allows me to handle the domain trickery that spammers/scammers would use to
fool people with twi.bz. This enables me to spot amazon.com and not confuse it
with amazon.co.uk or amazon.ru

------
bonsaitree
Unfortunately it's wrong for certain countries such as Thailand (.th) which
only allow for 3rd-level (e.g. .*.th) public domain registrations.

~~~
gojomo
I think you may be reading it wrong, both syntax and purpose. The section for
'.th' reads:

    
    
      // th : http://en.wikipedia.org/wiki/.th
      // Submitted by registry <krit@thains.co.th> 2008-06-17
      th
      ac.th
      co.th
      go.th
      in.th
      mi.th
      net.th
      or.th
    

This means for any of the seven listed 2nd-level domains -- 'ac.th' ...
'or.th' -- the 3rd-level is considered the assigned-by-a-registrar level. Only
if another 2nd-level domain, other than those seven, were encountered, would
the list suggest it be considered its own level-of-assignment.

If there is such a 2nd-level domain inside '.th', that should be another
public suffix, you should file a bug against the list with the Mozilla
Project. (If it is policy of the '.th' registry that every 2nd-level domain
with '.th' should be treated this was, an entry of...

    
    
      *‍.th
    

...should be added to the list.)

Also, don't be caught up on the 'public' part of the name -- it doesn't mean
this is a guide to what domains are registerable by 'the public'. Many of the
TLDs/2LDs/3LDs listed only allow subdomain-registration to specific entities,
like governmental bodies. In my project, we call the subdomains that are one-
segment-more than these 'public suffixes' "Assignment-Level Domains" (ALDs).

So if you're considering 'www.whitehouse.gov', and 'gov' is the longest suffix
in the list, then 'whitehouse.gov' is the Assignment-Level Domain. If you're
considering 'www.grad.mahidol.ac.th', and 'ac.th' is the longest suffix in the
list, then 'mahidol.ac.th' is the Assignment-Level Domain. (It's _one more_
than the best-matching suffix.)

