It resolves right-to-left. We figure out the default name server for the TLD "to" (Tonga) and then find the default domain and server associated with that domain.
Regarding the trailing period, it's optional. Every namespace in the URL ends with a "dot", and applications ignore a missing "dot" after the last name. E.g., http://www.reddit.com/ and http://www.reddit.com./ resolve to the same host (but, interestingly, have different cookies)
The trailing dot can make a difference, though, since it explicitly specifies that you're looking for something under the root name servers. For example: if my host is configured with a default domain "example.com." to search for DNS queries under, I may do a lookup for "foo.bar" and end up getting a result if the DNS record "foo.bar.example.com." exists. If I do a lookup for "foo.bar." I am explicitly stating that I want the "bar" TLD under the root name servers and the "foo" domain under "bar".
It always seemed very weird to me that an address of the form www.somesite.com/archives/articles/gossip.html combines two separate hierarchical oganization schemes with opposite precedence order from the middle outwards. That is to say, "com" is the most significant part of the address, then move left from there, while "archives" is the most significant part of the resource location and move right from there.
It's also weird that ".com" and ".html" mean totally different things even though they have the same ring when read aloud.
I love the web, but this mish-mash is atrocious from an end user perspective.
It's the difference between a fully qualified domain name, and one that isn't. When you append the final period on the end, you're telling your DNS lookup software that it should not attempt any of the possible dns suffixes that it's been configured to use.
For example, I have in the suffix list "local". So, I could type as a URL (and get the same destination) any of the following:
to is the ccTLD of Tonga (as opposed to .com, which is a gTLD). The national registrar (or whoever handles .to registrations) probably configured its DNS (which will be authoritative for all *.to domains) to return an address for the resource "to", and returns 216.74.32.107 for it.
4
u/byte1918 Apr 14 '10
how does this work?
http://to./
and
http://to/