In addition, if you have the setting Dawid talks about set to either require www, you will need an alias in the site for the other variation of the domain without the www. For example, if on the site you have the domain set as "www.mydomain.com", you will need a domain alias for "mydomain.com" as well. This will allow either domain (with or without www) to be brought up. Now if you have always force non-www, then you'll want the "mydomain.com" in the site domain and "www.mydomain.com" as the alias.
When the setting is forcing WWW or non-WWW it performs a redirect to the other domain and if that domain is not an alias or the actual domain, the system can't bring it up.