
Ask HN: why are domain names reversely ordered? - riobard
Why is it www.google.com instead of com.google.www? Tried searching for a good explanation but found nothing helpful. Is there any solid reasons for the arrangement, or is it just a random choice?<p>[EDIT]: as bajsejohannes points out, the major problem of the current arrangement is that it differs from the order of the path component, as in<p><pre><code>    www.google.com/path/to/the/file
</code></pre>
it really makes more sense to say<p><pre><code>    com.google.www/path/to/the/file</code></pre>
======
jws
I think it comes down to history. Host names existed before domain names. When
domains were bolted on they used the idea of a default domain for each host
and that made sense to be on the end.

Consider:

    
    
      telnet hosta          # established way
      telnet hosta.abc      # domain bolted on back
      telnet abc.hosta      # domain bolted on front
    

Since people knew the host names and were used to dealing with them, the
suffix was more natural since it kept the domain cruft out at the edge.

~~~
cduan
This seems pretty much right based on the historical data.

It doesn't seem like ordering of domain name parts was given much thought. RFC
882, which first defined the domain name space, said only this:

 _By convention, the labels that compose a domain name are read left to right,
from the most specific (lowest) to the least specific (highest)._

Additionally, it seems that when the first TLD was defined, .arpa, some people
were hacking to support it by just concatenating .arpa to the end of all the
domain names. Concatenation, of course, is much easier than prepending when
you are programming in C. Note the following from RFC 881, which described the
transition to using domain names, at a time when the domain name mapping was
all stored in HOSTS.TXT files:

 _So far, no new domains have been introduced. Only a table with all the
entries having official names in the ARPA domain has been provided. This
should allow programs to be constructed to deal with domain style names in a
general way without any special hacks to add or delete the string ".ARPA" to
or from host names._

------
bajsejohannes
(Just to clarify...) I know what you mean, but I don't think your question
makes sense without comparing it to something. That something would naturally
be the path.

www.google.com makes as much sense as com.google.www

but

www.google.com/root/sub/subsub makes less sense than
com.google.www/root/sub/subsub or subsub/sub/root/www.google.com

Since the latter has consistent increasing or decreasing of specificity, while
the former has not.

This incidentally mirrors what I don't like about the date format MM/DD/YY.

~~~
riobard
That's exactly what is in my mind! The mismatch of domain name order and path
order really bothers me for a while and I just couldn't find a sound reason
for that.

For the date format, AFAIK, only English speaking countries use MM/DD/YY,
possibly due to the same order in plain writing style, e.g. October 17, 2009.
This is completely insane for virtually other parts of the world because
logically it's either YY/MM/DD (big to small) or DD/MM/YY (small to big), but
NEVER MIXED!

~~~
etherealG
actually, only USA does the rediculous MM/DD/YY. the UK is DD/MM/YY

~~~
pbhjpbhj
Plus when saying a date it is usual to say the day first in the UK then the
month if it's not clear from context. The US date ordering is one of those
things (like non-metric units) that make me feel that they're being
purposefully obstructive; kinda like Microsoft, always avoiding using other
peoples agreed standards.

------
sammcd
Interview with Tim Berners-Lee where he says he regrets this:

[http://www.impactlab.com/2006/03/25/interview-with-tim-
berne...](http://www.impactlab.com/2006/03/25/interview-with-tim-berners-lee/)

Looking at what he accomplished, I forgive him.

~~~
vidarh
If he had done that it would've been massively confusing, given that domain
names would still be the current ordering for everything else (e-mail etc.).

------
gojomo
Why? Independent invention of the domain name system, and the URL-path system,
at different times by different people.

URL-inventors did not think it important enough to break the already-
established convention for domain names to acheive hierarchical ordering
consistency. With hindsight, nearly 20 years later, it might seem that it
would have been worth the nonstandard novelty, but I still wouldn't be so
sure.

Consistency with telnet and email was very important for early URL
comprehension and adoption among technical folk. And, the reversal-of-ordering
corresponds with an important threshold in URL-resolution, from one system
(network-layer and owned-domains in a collaborative framework) to another (a
single hostname's internal organization, usually under a unified authority).
That signification can be helpful even if it's hard to explain why. (The same
goes for seemingly arbitrary, path-dependent choices in natural language
grammars that nonetheless dominate logically-designed synthetic languages.)

It's easy enough for specialized applications to adopt a reversed form;
junklight mentions the 'SURT' form used by my project, Heritrix, which
reorders a URI internally for certain scoping/sorting/policy-decision purposes
as:

    
    
      http://(com,example,www,)/path/to/the/resource
    

(joshu's proposed move of the port/protocol to 'between' the host and path
also has a strong puff of logic about it. I think Google, in their BigTable
URI-keys, tends to reverse domain-segments and put the protocol/port later.)

------
aristus
It's just a convention, and one that took a while to work itself out. Some
older mail servers used to route (and even rewrite -- shudder) domains the
other way round. Like little- and big-endian numbers, the merits of either
method are less important than having everyone do it the same way.

<http://catb.org/jargon/html/B/big-endian.html>

------
s3graham
I have no idea. UUCP (Usenet) addresses used to be (are?) "backwards" and !
separated. Maybe some historical references related to that would point you to
more info.

If I were to guess though, I'd guess email addresses. me@machine being
originally valid makes me@tld.machine harder to parse?

~~~
joshu
They weren't really addresses; it was a series of hosts. It was thus more like
a route.

------
spidaman
I think everybody that has to write applications that deal with URLs as core
identifiers have asked this. It's also hairy 'cause leading part of a URL
(protocol and hostname) is case insensitive but the trailing part (path, query
string and fragment) isn't. At my last job I created a framework for
normalizing and canonicalizing URLs as well as storing them consistently (with
the hostname components reversed), it was a big improvement for retrieval and
duplication detection accuracy and performance.

------
anigbrowl
For the same reason your address doesn't go 'USA, California, San Jose, 1297
Fray way'.

~~~
jacquesm
Bad analogy:

email:

    
    
       georgex@somedomain.sometld
    

www:

    
    
       http://somedomain.sometld/~georgex/
    

real life:

    
    
       George Xandros 
       553 Sunset Blvd
       12322 San Jose
       USA
    

So, the web is mixed up, and the other two are 'backwards'. None of them get
it in the most logical way.

Same with dates:

    
    
       2002.10.09
    

vs

    
    
       09.10.2002
    

or

    
    
       10.09.2002
    

It's all about conventions, what we're used to, so to say 'the same reason' is
calling upon a reason that you don't state, when if you thought about it long
enough would boil down to 'that's how we've always done it'.

But that doesn't really answer the question.

The most 'logical' order is to put the larger units up front, and smaller ones
towards the end.

But since we are where we are that isn't going to change 'for the same reason'
(too much investment) that England isn't going to switch to driving on the
'right' side of the road.

Once a convention is established even if there is a marginally better one the
cost of switching usually outweighs the advantage of the switch, not to
mention a whole bunch of messy stuff during the transition.

~~~
robgough
Is there a clear benefit to driving on the right hand side of the road, over
the left?

~~~
jacquesm
On the whole there might be, but I'm not sure of that. In the current
situation, yes, because there is a cost associated with having to support two
kinds of driving styles.

I have both 'LHD' and 'RHD' cars and find that I can switch at will, but most
people are uncomfortable in the 'wrong' kind of car because it messes up your
overview when overtaking on 'b' roads (two laners).

If everybody would be driving the same kind of car on the same kind of road
then that problem would go away.

------
jbert
Because the US internet won out over the UK JANET?

<http://en.wikipedia.org/wiki/JANET_NRS>

Which caused no end of problems in mail relay at the time.

~~~
mdoar
Yes, I think this is the answer. There are two choices, so being human, we
chose both. Then eventually chose one of those two. I used to have an email
address jmsd@uk.ac.cam.cl i.e. with the domains reversed.

~Matt

------
philwelch
If it was ordered com.google.www, you might not even need to use different
characters for path separators than domain separators.

com.google.www.path.to.the.file

com/google/www/path/to/the/file

------
timf
Has anyone written a browser plugin that makes it seem like everything is
reversed (or 'correct' if that's your view)?

~~~
jacquesm
That would be pretty invasive, because plenty of the places where the urls
appear are not so easy to get to.

Statusbar, url bar, hovers over links, view source etc.

------
joshu
com.google:http/80:/path/to/the/file perhaps?

~~~
cema
Or even

    
    
      com/google:http/80:path/to/the/file
    

However, it could just as conceivably be

    
    
      http/80:com/google:path/to/the/file
    

because, imho, the protocol and port are not really part of the hierarchical
structure (part of the url, but not necessarily part of the uri).

------
jacquesm
This is widely considered to be a mistake.

~~~
tokenadult
_This is widely considered to be a mistake._

Citations, please? I've been able to deal with it over the years.

~~~
junklight
It turns out to be a complete pain for working out scope in Web crawlers
because you need to separate the domain from the path part and deal with them
separately. If it was in the opposite order it would be much simpler to
process.

The Heritrix crawler (primarily worked on by the Internet Archive) introduces
a "surt" form which is basically the domain in the same order as the path so
that Reading from left to right it goes from least specific to most specific.

~~~
jacquesm
Crawling is an inconvenience, sure it is problematic, but phishing is much
more problematic. You can train a machine to parse that thing right-to-left no
problem, to tell users to start middle-to-left and then middle-to-right is too
much of a burden.

~~~
junklight
Agreed. Not so much "a burden" as something that you will never be able to
teach a large number of people.

