๐Ÿ“š General & Other

The Domain Is Not Just the Last Two Labels

Extracting a registrable domain by taking the final two dot-separated labels works for and fails for a great many real hostnames.

Extracting a registrable domain by taking the final two dot-separated labels works for example.com and fails for a great many real hostnames.

Multi-part suffixes

example.co.uk has a registrable domain of example.co.uk, not co.uk. The same applies to com.au, co.jp and hundreds of others. There is no algorithmic rule for this โ€” it requires the Public Suffix List, a maintained dataset of which suffixes are public registries.

Platform subdomains count as suffixes

github.io, blogspot.com and similar are on the Public Suffix List, so user.github.io is a registrable domain in its own right. Treating those as one site collapses thousands of independent sites into a single row.

Practical guidance

Use a library backed by the Public Suffix List rather than string splitting. If you must split manually, at minimum decide explicitly whether www is stripped and apply that consistently โ€” www.example.com and example.com as separate rows is the most common cause of a referring-domain count that looks too high.

Try it: Extract Domain from URLs on SeoWolf's Notepad.