Search code examples
dnstld

Is `domain dot tld` the same as `domain dot tld dot` ? (dot after TLD)


I seem to understand that a dot after the TLD doesn't matter, eg: http://example.com/somepage/ == http://example.com./somepage/ (notice the dot after the TLD)

My question is: is this always the case? Or is it DNS or anything dependent? In other words, will an extra dot after the domain work for everybody, no matter what the setup and the domain? (example.com., localhost., mycomputer.lan., 127.0.0.1., etc...)

Bonus question: why is that extra dot allowed?

Thanks


Solution

  • The extra dot, after the top level domain name, for example com. or gov. , is valid and optional as per DNS specifications. More details here.

    However, this must not be used with anything that is not a domain name and that does not require a domain lookup. In your examples, it cannot be used with IP address and host name for above reasons. The optional last dot is guaranteed to work with any domain name. If mycom.lan is a domain name, where you are hosting a zone named "LAN" in your intranet, then the trailing dot can be used.

    Bonus Answer: the last dot represents the "root zone". :), which must be looked up to find the nameservers of top level domains like com, gov, org, etc. Its however optional to type it. You can try this in the browser URLs.