Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is it called when a website has another word in place of where www usually goes? For example, images.google.com vs google.com/images. I know the latter is a file on the server that the browser downloads, but what exactly is the purpose of the former? It would be helpful to know what this is called.

share|improve this question
google.com/images is a sub-directory and not a file –  Alok Aug 19 '13 at 22:17

5 Answers 5

up vote 16 down vote accepted

This is is called a subdomain.

Subdomains can be routed via the cname entry to a different server so that when the user types in foo.bar.com, the nameserver for bar.com is examined, which reveals the IP address for the foo subdomain.

share|improve this answer
Perfect, thank you so much! I can find more information by myself now. It was hard to describe in a Google query without knowing the name haha. I'll mark you as the right answer as soon as it lets me. –  Carpetfizz Aug 19 '13 at 15:18
foo is a host. bar is a subdomain. (com is also technically speaking a subdomain of the root domain ..) –  Jörg W Mittag Aug 19 '13 at 16:08
@Carpetfizz - For what it's worth, www is also a subdomain, just one that's by convention used for the main webserver. –  Bobson Aug 19 '13 at 16:11

Back before the world wide web was invented, servers used the convention of using different host names to access different services. So, for example, if "Example Corporation" had a public server, it was named "example.com". If they provided public ftp access, it would be accessible through the hostname "ftp.example.com". The "ftp" part identified an actual server machine on the subdomain "example.com".

Likewise, if "example.com" provided a public smtp server, it would be "smtp.example.com". If they provided a gopher server, it would be "gopher.example.com". When web servers were invented, pretty much everyone stuck to this convention and named their websites with "www" (eg: www.example.com).

This is simply a convention. Once websites started to proliferate, sites started using their corporate hostname as the main website to make it easier for people to get to the website, so instead of "www.example.com", the simpler "example.com" would be routed to the web server. As traffic increased, they could have multiple servers, with a load balancer sitting between "example.com" and the various servers that power it.

share|improve this answer

This is usuall accomplished by a url redirect. No page is ever downloaded. Your browser requests the /images resource from the web server (sitting at google.com). The webserver responds saying "this is not the resource you're looking for" and points your browser to images.google.com (like the Bugs Bunny cartoon where Elmer Fudd asks "the park ranger" which way the wascally wabbit went and "the park ranger" says he went thataway).

Your browser then goes to images.google.com and says gimme what you got (or "get /"). The server responds with the appropriate resource.

share|improve this answer
I like this answer for the fact you used Bugs Bunny and Elmer Fudd to to explain redirections and browser requests! ;) –  Keldon Alleyne Aug 19 '13 at 15:30
Haha this cleared it up as well, thanks! –  Carpetfizz Aug 19 '13 at 15:40
I try not to take myself too seriously :) –  Mike Brown Aug 19 '13 at 17:40

As Keldon said, subdomain is the term you are looking for.

The purpose is generally/originally was to allow someone to control their own mappings of the names to various IP addresses / servers by providing a domain name server themselves rather than registering a bunch of separate domains.

These days there are a fair number of people that use subdomains on the same IP address to do things with cookie/script scope, or to allow their networking hardware to decide where to route the traffic.

For example, resources embedded withing my pages like photos might be referred to at a subdomain like http://staticresource.xyzcompany.com and in my load balancer I could route those through a cache appliance even though they live on the main http://xyzcomapny.com domain. This lowers the load on my actual web server and speeds up page loads to the clients without be having to do separate deploys and maintain separate actual servers.

I can also use it as it was originally used and assign a separate subdomain to a separate IP address on a separate server to http://scaryadmintools.xyzcompany.com then put different rules and settings on that server to increase security while isolating that overhead from the general marketing site at the main domain.

share|improve this answer
Good point. To add to your network routing rules, I believe that IE also has the ability to say certain sites are whitelisted, but not certain paths on a site. –  MichaelT Aug 19 '13 at 15:35
Thank you for your answer! –  Carpetfizz Aug 19 '13 at 15:39
Most browsers can do that with certificate scopes and such... There are a lot of reasons that you can do this, these are just the ones that happen the most and are explainable. Tokenized subdomains or CDN internals with shortest response DNS are another good use here, but explaining the how of that gets confusing to many people in my experience. –  Bill Aug 19 '13 at 15:43

The host name www is a host name. It makes it convenient for people to know where to go for a given service, and as a convention, just entering the domain name (for example google) in many browsers, the browser will go to www.domain.com.

However, this points to a host (load balanced it may be), but it points to one server (-ish, yes, there's dns round robin too). This can cause significant traffic to one server, which can be a bad thing.

It is a standard approach to split the dynamic content and static content into two parts and host the static content on a CDN (Content Delivery Network). This requires pointing dns to a different server. As such, the host name for the dynamic content cannot be the same as the static content.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.