reg-dom-libs are a set of libraries for
Perl to convert an arbitrary domain name to the registered domain name.
- For simple domains, like
news.ycombinator.com, the task is trivial.
- For more complicated ones, like
www.japantimes.co.jp, handling the second level subdomain is a little painful.
- For exoteric ones, like
公司.cn, the problem becomes virtually impossible.
- After seeing stupid ones, like
www.comune.caserta.it(believe it or not, the registered domain is
comune.caserta.it!), I gave up finding an elegant algorithm for the problem.
- A full list of valid registered domain is necessary. Luckily, it is available (and nightly updated) here.