Skip to content
Back to DNS

My www.domain.com doesn't work, but domain.com does (or vice versa)


If your website works at domain.com but not at www.domain.com (or the other way around), there are two common causes: a missing DNS record, or a DNS caching delay after a recent change.

1. Check both DNS records exist

domain.com and www.domain.com each need their own DNS record pointing to your hosting:

  • domain.com needs an A record pointing to your hosting package's IP address.
  • www.domain.com needs either an A record pointing to the same IP address, or a CNAME record pointing to domain.com.

To find your package's IP address, see How do I find the IP address of a hosting package?

Check and add any missing record where your domain's DNS is managed:

  • StackCP nameservers (ns1.stackdns.com to ns4.stackdns.com): log into StackCP by following this guide and select Manage DNS.
  • Westhost nameservers (dns1.westhost.com to dns3.westhost.com): edit the DNS in your CHI account. See How To Manage DNS.
  • Another provider's nameservers: edit the DNS in that provider's control panel.

DNS changes can take up to 24 hours to take effect.

2. Wait for DNS caching to clear

If both records are correct and you've recently changed your DNS, or set up a new hosting package, it's almost certainly a DNS propagation delay. It will resolve itself within a few hours.

This happens because your computer and your internet provider store (cache) DNS lookups for a while. If you visited www.domain.com before the change, its old IP address may still be cached, so you see the old site or an error. If you hadn't visited domain.com (without the www) recently, nothing was cached, so a fresh lookup found the new, correct IP address. That's why one works and the other doesn't. The same can happen the other way around.

The only fix is to wait for the cache to expire. Your next visit will then do a fresh lookup and get the new IP address. If your domain uses our nameservers, this usually takes no longer than an hour.