www.foo.com
is not strictly speaking a URL. It's a relative domain name.
It means this: start with your local domains, falling back to the root if you can't find anything there and traverse through com
and foo
to get to www
. It doesn't say what records to grab from that domain though or what you would do with those records if you did retrieve them.
Most commonly the record of interest is an address record which allows the domain name to be used as a hostname to refer to a machine. There are other kinds of DNS records though.
The www
is just the last name in the chain, and it is completely arbitrary. There's a convention of naming the host of the primary Web server for a domain www
but that is just a convenience for humans, not something meant to be recognizable to machines. Even then, there are things you can do with machines running webservers other than requesting Web pages from them.
So, not all web servers are named www
and just naming one doesn't say what you want to do with it anyway.
That's where URL come in. They tell you how to get to something. They start by telling you how to get it, then where.
How is specified as a "sheme" and for the web, the scheme is either http
for regular requests or https
for secure requests. Then a separator ://
then a hostname telling you where the web server is (maybe a DNS name, maybe something else like an I address or a locally defined name) then a path indicating where the pages is on the web server. (There are a bunch of details I'm skipping over).
It is generally considered good practice to allow www
but not encourage it by pointing the address records of both the base domain and that plus www
at we servers meant to act as public facing entry points, and then to favour the non www
name.
If you want to provide a proper URL that unambiguously shows that you are referring to a website, provide a full URL.
http://example.ca/
https://myexample.foo.org/
burger.com
is a website, whereasburger.biz
is much more uncertain to me (could be a poorly chosen brand name). – Dom Jun 17 '15 at 23:16ait.ie
works and redirects towww.ait.ie
. In fact, it doesn't. Firefox sees thatait.ie
doesn't work, and redirects towww.ait.ie
for me. Not all browsers do that. – TRiG Jun 19 '15 at 0:41