3 ms·
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?
by neals 6y ago
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?
- eropple 6y agoThe trailing dot tells your resolver to not attempt to use your local list of search domains.
- zaphar 6y agoThat 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.
- eropple 6y agoSure. I was responding to a post that asked: > When / how / why would you use the trailing dot?
- wyattpeak 6y agoWhile 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.
- adrianmonk 6y agoA 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.