LibTLD can extract the top level domain from any URI / IRL.
It recognizes all TLDs, even multiple level TLDs (i.e. up to 4 parts for
.schools.nsw.edu.au), checks with the Mozilla TLD database and supports
over 2000 variants. It is provided as C library, with bindings for C++
1.4.2012 Oct 2014 22:45