I used to type the website URL without the "www" and it works fine with almost all sites that I have tried, so far.

But I realize that my university's website never show up if you don't type the "www" before.

Typing this

 http://u-psud.fr/

shows a dead page, but adding the "www" works well:

 http://www.u-psud.fr/

Why is it not working for one's own site, or why is it working for the other website :)

link|improve this question
1  
Why the close votes? Maybe this person really doesn't know. – John Saunders Jul 7 '09 at 10:21
Not really programming-related, but could be of use to web developers – activa Jul 7 '09 at 10:23
3  
seriouslly??? would I bother asking if I know the answer, r u ok people out here??? – dotnet_1 Jul 7 '09 at 10:24
1  
Seems more of an end-user question than a serverfault "sysadmin" question. Belongs elsewhere? – Brian Knoblauch Jul 7 '09 at 13:53
1  
For someone new in server admin who doesn't know how DNS works I think this is a completely valid question. Its asking how DNS works. – SpaceManSpiff Jul 7 '09 at 15:36
show 2 more comments
feedback

7 Answers

up vote 10 down vote accepted

The "www" part is not really a standard. It's a tradition. It's up to the webmaster/sysadmin to make it work. Just because most sites have enabled both ways (with www and without www), doesn't mean that they have to. In fact, have you noticed that some websites have something like www1, www2, etc.? That's because the sysadmin can decide what he/she wants to put there (or if he/she wants to put anything there at all). As I said - it's just a tradition.

link|improve this answer
feedback

It's because the "www." is part of the DNS name that resolves to their web server's addresses. The ones that don't have "www." don't have it as part of their DNS name.

link|improve this answer
is that means "google.com" and "www.google.com" are not the same?? – dotnet_1 Jul 7 '09 at 10:22
1  
It means there are two DNS names, and that they probably point to the same set of IP addresses. – John Saunders Jul 7 '09 at 10:22
2  
It's not sufficient to set up two domain names in DNS. The webserver also has to be bound to both names – activa Jul 7 '09 at 10:24
1  
@activa, sorta kinda yes but not always. If you have one IP address for one website, I think most web servers will traditionally accept any old host header and point them at that site. If you have a complex set up with several sites/URLs using one IP address then yes you'd need to set up host headers. But this is just telling the web server what to accept, the issue with "www or not www" is a DNS issue. – DJ Pon3 Jul 7 '09 at 10:50
feedback

The part of the URL before the domain name (the www. in this example) is normally interpreted as the logical name of the computer on that domain's network that is required (so you might have a server which calls itself 'www', one which calls itself 'mail', etc.).

If you don't specify a specific domain resource then the default is used, and normally that's set up to be www, but some network admins won't have set this up for whatever reason and so you must enter the www explicitly to get to that resource.

link|improve this answer
feedback

Let's look at the specific examples:

$ nslookup u-psud.fr
Server:     192.168.0.1
Address:    192.168.0.1#53

Non-authoritative answer:
Name:   u-psud.fr
Address: 129.175.33.40

So, u-psud.fr -> 129.175.33.40

$ nslookup www.u-psud.fr
Server:     192.168.0.1
Address:    192.168.0.1#53

Non-authoritative answer:
www.u-psud.fr   canonical name = cms10-default.u-psud.fr.
Name:   cms10-default.u-psud.fr
Address: 129.175.125.111

And, www.u-psud.fr -> 129.175.125.111

So, in short, you are connecting to two different web servers.

The history of this is more convoluted. A long time ago, as the Internet grew in popularity, many of the services you know were only growing in popularity. Most of the users were local, so systems often appeared as what they were named locally. (I saw a list circa 1990 that showed the most popular hostnames were things like: calvin, hobbes, mac1, mac2, etc.)

When the Internet usage became more globalized, smart administrators started naming their SMTP hosts "mail", their POP servers "pop" and their FTP servers "ftp". (You would be amazed how hard it was to convince people this made sense...)

For a long time, DNS-smart-but-lazy administrators tried to serve everything off a server for the top level entry (domain.com). These days, few administrators are this foolhardy, you need to spread out the load across several systems. From a naming perspective, using the name-of-service-in-the-domainname makes a lot of sense for end users, it is hard to get wrong.

link|improve this answer
feedback

This is the responsibility of whoever sets up the web server. In order for both domain names to work, there should be DNS entries for both names (usually one is an alias for the other), AND the website should be linked to both names.

link|improve this answer
feedback

There is even a movement against the usage of www which technically should be a subdomain.

They say that, by default, all popular Web browsers assume the HTTP protocol. In doing so, the software prepends the 'http://' onto the requested URL and automatically connect to the HTTP server on port 80. Why then do many servers require their websites to communicate through the www subdomain? Mail servers do not require you to send emails to recipient@mail.domain.com. Likewise, web servers should allow access to their pages though the main domain unless a particular subdomain is required.

Succinctly, use of the www subdomain is redundant and time consuming to communicate. The internet, media, and society are all better off without it.

It used to be located here.

link|improve this answer
feedback

A lot of sites set their name and suffix in the DNS, e.g. google.com and may be set to allow all non-specified sub-sites to go there.

My website (it's rubbish) is setup as cksiteoftreats.co.uk, but you can put anything in front of it and it will work:

useless.cksiteoftreats.co.uk

whatishethingking.cksiteoftreats.co.uk

serverfault.com.cksiteoftreats.co.uk
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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