News for hackers. Stuff that matters.
Re:List of All Current TLDs by mike_d on Thursday September 10, 2020 @07:23PM (#24437644)
The IANA TLD list should never be used directly. What you really want instead is the Public Suffix List [1]. It will help you determine the "effective TLD" of domains like amazon.co.uk or sflawlib.ci.sf.ca.us, and gives you more insight in to how a technical allocation at the root transforms politically in to implementation.

1. https://publicsuffix.org/list/public_suffix_list.dat

Re:List of All Current TLDs by sleevi on Friday September 11, 2020 @08:26AM (#24441942)
PSL maintainer here: please don’t use the PSL!

Yes, it’s weird to have a maintainer asking people not to use their project, but the PSL was a very specific (and unfortunate) hack for a very specific (and unfortunate, and browser-created) problem. It is something we live with, not something we like. While the ideal world is “don’t use any list at all, use the protocols as God, the IETF, and IANA intended”, if you are going to use a list, using the IANA list, updated daily, is much better than the PSL.

Do not use the PSL for anything that is not “cookies abusing the Host header”

https://github.com/sleevi/psl-problems

Re:List of All Current TLDs by Lvl999Noob on Friday September 11, 2020 @09:16AM (#24442414)
Are you still adding suffixes to the list? If so, wouldn't refusing to add new suffixes help with the issue? If no new organisation can make use of PSL to link their subdomains, then they are only left with SOP. Since the list stays like it is now, no existing websites, depending on the list suddenly break down.
Re:List of All Current TLDs by sleevi on Friday September 11, 2020 @09:34AM (#24442604)
We are. Deliberate sabotage like that would take quite a while before it was noticed, however, and it wouldn’t magically fix cookies and how people use them.

To the extent it is used by cookies, we still want to maintain a fair and equitable solution. However, we also want to actively discourage any new users or use cases, to the extent possible, while we also try to fix cookies.

Ideas like https://github.com/privacycg/first-party-sets provide a possible model. While FPS doesn’t directly address this, as part of keeping a narrow scope, the approach to explicitly expressing boundaries is one that has the best viable path. However, that’s effectively “Deprecate the Host option for cookies”, so... that’s a big task.

Simply sabotaging the PSL doesn’t force the problem to be solved, so mostly, it’s an education campaign of “We made a mistake; learn from ours, rather than repeating it.”

Re:List of All Current TLDs by tialaramex on Friday September 11, 2020 @12:32PM (#24444476)
Interesting. Does this mean that - without your Google hat on at least - you would prefer that references to the PSL were removed from the CA/B BRs as well?

WebAuthn ends up relying on the PSL as well (via a concept of "registrable domains" and WHATWG). Presumably you'd want that to just require Same Origin instead?

Re:List of All Current TLDs by sleevi on Friday September 11, 2020 @07:12PM (#24448305)
Yes.

The WebAuthN case in particular is quite unfortunate, and one I tried to discourage early on (along with the whole app facets approach)

Re:List of All Current TLDs by methyl on Friday September 11, 2020 @08:34AM (#24442015)
It has pretty strong usecase in SEO where you want to determine number of unique root domains that are linking to some page.
Re:List of All Current TLDs by pbronez on Friday September 11, 2020 @10:55AM (#24443483)
The annotations and formatting make your list way more useful than the official IANA one. I appreciate the links to learn more about each TLD.
Re:List of All Current TLDs by darnir on Thursday September 10, 2020 @07:49PM (#24437817)
And then also, please don't parse the PSL yourself. Use an existing library[1] for that. The formal algorithm for finding the TLD is more complicated than you realise at first glance.

I would recommend libPSL[2]. It was written by one of the maintainers of GNU Wget and is currently used by both GNU Wget and libcurl.

Disclosure: I was one of the early contributors to libpsl and closely involved in its initial formation.

[1] https://publicsuffix.org/learn/ [2] https://github.com/rockdaboot/libpsl

Re:List of All Current TLDs by CodesInChaos on Friday September 11, 2020 @04:18AM (#24440285)
In what way is it more complicated that one would naively expect? And why?
Re:List of All Current TLDs by exikyut on Friday September 11, 2020 @04:28AM (#24440349)
I'm not sure.

https://github.com/rockdaboot/libpsl/blob/master/src/psl.c is 2K lines, most of it appears to deal with memory management, character twiddling, and processing/conversion.

Maybe the cookie management?

Re:List of All Current TLDs by knome on Friday September 11, 2020 @08:39AM (#24442070)
For one, it appears to handle punycode internally.

Punycode is a method for encoding international unicode into ascii prefixed with XN--. So this will correctly associate cookies for either the unicode term or its punycode ascii equivalent.

As exanples, wikipedia indicates the international domains with the most name registrations as being the russia's "рф", taiwan's "台灣" and china's "中国", which are represented in DNS as "xn--p1ai", "xn--kpry57d", and "xn--fiqs8s", respectively.

The data appears to indicate hosting sites where users can register their own names against a providers domain ( username.example.com ) as well as exceptions to this where the host's own site then uses subdomains ( www.example.com, admin.example.com, cdn.example.com ) and the host's cookies should still be used.

It lists specific tlds, wildcards where appropriate with *, and notes exceptions to wildcarding by prefixing with !.

Certainly far from something that would be impossible to write your own parser for, but getting everything right on your first go would be harder than one might expect, and getting things wrong here would be likely to leak the user's information between various sites.

Re:List of All Current TLDs by sleevi on Friday September 11, 2020 @08:43AM (#24442119)
https://publicsuffix.org/list/ (See the Algorithm)

Is actually hard to implement correctly and interoperably, even among browsers, and there are sharp edge cases along the way (such as holes within domain trees).

The author of the library referenced at least worked with the PSL maintainers and browsers to make sure they were faithfully and correctly implementing things :)

Re:List of All Current TLDs by ficklepickle on Friday September 11, 2020 @01:12PM (#24444913)
Here's one for ya. Legacy third/fourth level domains on ".ca". They were provincial/municipal respectively. Although new issuance was discontinued in 2010, they still exist.

For example, posts from ansuz.sooke.bc.ca have been popular on HN. Sooke is a municipality, BC is a province.

https://en.wikipedia.org/wiki/.ca#Third-level_(provincial)_a...

Re:List of All Current TLDs by quotemstr on Friday September 11, 2020 @03:11AM (#24439936)
I'm glad the PSL exists, but it's a really ugly hack. The public-ness of a domain should be a queryable DNS record. We shouldn't make tons of programs bundle what's essentially an out of band zone file when we could just use DNS as intended.

Yes, I know about the PSL DNS query service. That's only marginally better. The public suffix flag should be a record on the domain itself.

Re:List of All Current TLDs by schoen on Friday September 11, 2020 @05:52AM (#24440904)
There is a concluded IETF WG called dbound (I don't know why it concluded!) and a current Internet-Draft about doing this:

https://datatracker.ietf.org/doc/draft-levine-dbound-dns/

Re:List of All Current TLDs by sleevi on Friday September 11, 2020 @08:29AM (#24441967)
It concluded because, despite everyone agreeing they wanted a unicorn, they couldn’t agree which breed of unicorn they wanted, and thus were unable to get one.

Which is to say: things went wrong in circles because different folks had different problems, those different problems had incompatible requirements, and so things spun in circles for a number of years as every idea failed to solve the problem for everyone simultaneously, while narrowly-specified solutions were shot down for not solving enough problems.

Re:List of All Current TLDs by schoen on Friday September 11, 2020 @03:31PM (#24446451)
Is it still plausible that the remaining I-D will advance to an RFC?
Re:List of All Current TLDs by sleevi on Friday September 11, 2020 @07:47PM (#24448550)
Perhaps? But I’m not aware of anyone (besides the DMARC crew) who could implement this, or even having been involved, so it seems mostly moot?
Re:List of All Current TLDs by ricardo81 on Friday September 11, 2020 @03:44AM (#24440104)
Thankfully it exists and seems to be about one of the only sources in identifying 2nd and lower level TLDs.

I remember reading how browsers were accepting cookies that'd be sent to many other sites on the same host level because the browsers had no idea on what authority level to differentiate.

Re:List of All Current TLDs by JdeBP on Friday September 11, 2020 @05:40AM (#24440798)
"2nd level top-level domain"? (-:
Re:List of All Current TLDs by ricardo81 on Friday September 11, 2020 @06:35AM (#24441168)
Hehe, in my travels I haven't found a good moniker for them, as many people would call "co.uk" a TLD. Maybe the T can stand for "toppish".
Re:List of All Current TLDs by ZWoz on Friday September 11, 2020 @08:37AM (#24442043)
https://en.wikipedia.org/wiki/Top-level_domain - TLD is first level[1]. Domain directly on root. Domains like co.uk and so on are second level domains.

-----

[1] - or second, then again counting root as level 0 seems reasonable.

Re:List of All Current TLDs by ricardo81 on Friday September 11, 2020 @09:14AM (#24442402)
Yes, apparently "SLD" is quite a common term but it does not encapsulate the likes of 'pvt.k12.ma.us' or 'uk.com' (in the sense that it's not a registry per se for the latter)

So there's an awkward way of defining things in various contexts, like cookie permissions, whether a domain is registerable, whether it is a registry the next level up

Re:List of All Current TLDs by ZWoz on Friday September 11, 2020 @09:43AM (#24442698)
uk.com is second level, pvt.k12.ma.us fourth. I think you really look words for denoting political separation (instead technical), but I don't know any good terminology for that. Public suffix is probably best term to differentiate between "shared" and "dedicated" namespace. Technically though, root servers have information only about TLD-s. co.uk may be special for some people, but a.root-servers.net. don't care, it's still sends you to uk TLD nameservers, like for every other second level domain. That political separation or what counts as "registry" is itself very tricky. Are dynamic DNS services registries? How about hosting (like blog) service provider, who gives subdomain/hostname for every client?
Re:List of All Current TLDs by ricardo81 on Friday September 11, 2020 @11:49AM (#24444050)
Well, exactly. Canonically they're often referred to as TLDs in the context of "this trusted authority delegates sub-level hosts" but it means something different to many clients.

As the original comment suggested it's a bit of a non sequitur to call anything below the initial host label to be a TLD. I was just suggesting there isn't a generally accepted moniker for what they're called.

The public suffix list makes some kind of definition, mainly for cookie-level permissions.

Re:List of All Current TLDs by ficklepickle on Friday September 11, 2020 @01:14PM (#24444945)
Re:List of All Current TLDs by ZWoz on Friday September 11, 2020 @08:33AM (#24442006)
Thats not really all inclusive list. Several second level domains are missing. Probably because some point it's pretty hazy, what is "public" suffix.
Re:List of All Current TLDs by neallindsay on Friday September 11, 2020 @08:39AM (#24442073)
> Several second level domains are missing.

Second level domains are by definition not top level domains.

-edit- Ha–I thought this was a top-level comment. I think that counts as irony.

Re:List of All Current TLDs by ZWoz on Friday September 11, 2020 @08:41AM (#24442086)
Whole point of publicsuffix.org is list second or third level domains, which are public. Otherwise we are back to IANA list, which is indeed TLD list.
Re:List of All Current TLDs by 1vuio0pswjnm7 on Friday September 11, 2020 @06:12AM (#24441013)
"... transforms politically in to implementations."

Is this list controlled by Mozilla. Or perhaps some group of browser oranisations/companies.

Personally, not speaking for any other user, I am not really a fan of the browser deciding what is or is not an "acceptable" TLD, because the browser is not the only program I use for generating and sending HTTP. I use a variety of programs. Perhaps if I have some control over the browser's list. For example, I the user can add or subtract "TLDs".

In the past I have done this by running an edited copy of the root.zone on the local network. I think it is a cleaner, less application-specific, solution than relying on a list compiled by a browser vendor(s).

Browsers can easily override the "IANA TLD list" as well as the DNS I set up on the local network. I am not saying they are doing this through this list, but the capability is there. Browsers like Firefox are certainly not shy about constantly manipulating how domains and urls display in an address bar, Chrome wants to "protect" the user from "evil" pages, etc. It is a slippery slope. I like the idea of overriding the IANA but not the idea of this being outside the control of the user, decided by some browser vendor(s). I do not want/need applications making decisions about what is or is not a TLD, or in this case what is a legitimate subdomain for purposes of cookies. I already do that through control over the zone files I serve and system resolver settings; I control, i.e. filter, cookies through a local proxy.

The root.zone has grown exponentially and is full of cruft now thanks to the "gTLD" scheme, as others have noted. If you really care about this stuff, I don't think you can rely on someone else to address the problem for you. Mozilla or whomever produces the "public suffix list" is no doubt tied to the online ad industry in some way, directly or indirectly.

Re:List of All Current TLDs by 1f60c on Friday September 11, 2020 @07:23AM (#24441481)
The public suffix list makes sure evil.github.io can’t read bob.github.io’s cookies, nothing more and nothing less.
Re:List of All Current TLDs by sjwright on Friday September 11, 2020 @09:33PM (#24449102)
It's not just cookies, it defines pretty much all aspects of a browser's security between websites. It sets the boundaries for cross-site scripting. It limits the scope of SSL wildcard certificates. And it's used to determine which part of the domain name gets highlighted in the URL bar.
Re:List of All Current TLDs by Spivak on Friday September 11, 2020 @12:45PM (#24444599)
Which kinda sucks because this is functionality that should be supported but and not require a global list to work. I should be able to set origin policy on any domain I control.
Re:List of All Current TLDs by 1vuio0pswjnm7 on Friday September 11, 2020 @08:48AM (#24442166)
This is a case of the browser vendor trying to solve a problem for the user that the browser vendor itself created. In this case, cookies from Netscape. At some point the risk outweighs the benefit. That's why you have GDPR.