code by Alan Dix, developed at Talis

Public Suffix (Second Level Domain) Helper

These pages provide a simple PHP class to parse, store and query the Public Suffix list.

The class code can be downloaded and used under the MIT license.

There are also code examples and documentation.

There is also a demonstration of its use where you can check a domain against the list, and you can also run the test cases developed byRob Stradling of Comodo.

about the public suffix list

Top Level Domains (TLDs) include the familiar country codes such as .uk, .fr; US codes such as .edu, .gov; the old international codes sucha s .org, .com; and the growing number of further level codes such as .name, .tv. They are adminstered centrally an it is easy to get a list of them.

However, many countries have a second tier of naming, for example, .co.uk and .ac.uk in the United Kingdom. The domain name system does not include a standard way for these to be updated, but they are important, for example to know whether you should be blocking all of .co.uk or just badsite.co.uk for malevolent behaviour.

Happily Mozilla and other browser vendors have created central repository, the Public Suffix List that is used in various browsers, including Firefox, Opera and Chrome to manage cookie policy.

The full list is updated and can be downloaded freely from here. It has a simple well documented ASCII file format (pretty much just a list!).