News for hackers. Stuff that matters.
Re:You can bypass YouTube ads by adding a dot after the domain by neals on Wednesday June 10, 2020 @03:35PM (#23481112)
I've never heard of this. When / how / why would you use the trailing dot? I checked my sites and they redirect to the non-trailing version. Is that bad?
Re:You can bypass YouTube ads by adding a dot after the domain by adrianmonk on Wednesday June 10, 2020 @04:30PM (#23481711)
A trailing "." represents the root of the DNS namespace like a leading "/" represents the root of the Linux (or Unix, etc.) filesystem.

The root has children like "com", "net", "uk", etc.

There are DNS records at the root level. Try this command:

    host -t ANY .
Also, just as Linux searches PATH (in order) when you run a command, the DNS resolver searches a path when you look up a host. (Usually the resolver path is specified by directives in /etc/resolv.conf.) Just as Linux will skip this process if you specify a leading "/", the DNS resolver will skip that process if you specify a trailing ".".

It used to be pretty common to put your organization's domain in /etc/resolv.conf so that you can use the short version of a hostname. If your company is example.com and you have example.com in the DNS search path, you can type a command like "ping www", and it will do the same thing as "ping www.example.com". Most software still supports this, but it isn't used by that many people. (Some organizations don't put their domain in /etc/resolv.conf, and many users don't know they can abbreviate hostnames in this way.)

You would typically use the trailing dot if you want to be sure the DNS lookup doesn't use the search path and checks only against the root of the DNS namespace. You also use the trailing dot in some data files for DNS servers.

In many cases the trailing dot is not necessary, practically speaking, because the DNS resolver has special logic where if you give it a string that contains any dots (not just trailing), the search order is rearranged to try the root first instead of last. (In /etc/resolv.conf, this is controlled by the "ndots" option.)

So if you look up "www.example.com", it will check for the existence of "www.example.com." before it checks for "www.example.com.example.com." instead of the other way around. Which is good because only the first is likely to exist. If you look up "www", it will check for "www.example.com." before it checks for "www.", which again is a good heuristic because again the first is the one that likely exists.

Re:You can bypass YouTube ads by adding a dot after the domain by neuos on Wednesday June 10, 2020 @06:23PM (#23482884)
I just tried it with the domain rakso.at and when I enter rakso.at. there is an htst error. Shouldn't it work because it is technically the same domain?
Re:You can bypass YouTube ads by adding a dot after the domain by exikyut on Wednesday June 10, 2020 @07:38PM (#23483449)
Out of idle curiosity I tested that domain too, and it works on my end (Chromium 80.0).
Re:You can bypass YouTube ads by adding a dot after the domain by eropple on Wednesday June 10, 2020 @03:42PM (#23481184)
The trailing dot tells your resolver to not attempt to use your local list of search domains.
Re:You can bypass YouTube ads by adding a dot after the domain by zaphar on Wednesday June 10, 2020 @03:57PM (#23481342)
That is an effect. But the standard states that a fully qualified domain ends with the dot. The reason your resolver doesn't use the search domains is because the dot tells it that what you provided is the entire thing so there is no point in looking up the domain in a search list.
Re:You can bypass YouTube ads by adding a dot after the domain by eropple on Wednesday June 10, 2020 @04:35PM (#23481778)
Sure. I was responding to a post that asked:

> When / how / why would you use the trailing dot?

Re:You can bypass YouTube ads by adding a dot after the domain by wyattpeak on Wednesday June 10, 2020 @10:38PM (#23484700)
While you're certainly not wrong, the phrasing of the question suggests that the asker didn't know the history of the final dot, and was asking the way they did only because they didn't know what to ask, thinking its purpose was to provide some effect rather than being historically (and currently) the correct FQDM.