Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does Firefox determine if something is a domain or a subdomain? Obviously the term subdomain is relative, so domain.com is already a subdomain of .com. But what about countries like the UK or South Africa where domains are commonly subdomains of .co.uk and .co.za?

Is there some generic way to know when a domain should be treated as a subdomain or do they basically hardcode the exceptions?

Example: does domain1.co.uk and domain2.co.uk share the same limit in Firefox? Probably not, but how does it know to treat them as separate?



I see there's a list online: http://publicsuffix.org/


There are already hardcoded lists for this that's used to limit the scope of cookies (so nobody can try to read all the cookies on *.uk).

I imagine these lists will become a real headache when the recent TLD auction is over. Is there any work being done on a more dynamic system (DNS TXT fields?)


There's a hardcoded list of TLDs in the browser's source code. They update it from time to time whenever there's a new .co.uk style TLD to add.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: