1

Let's say I have a domain name registered as www.example.com and I have hosted my site on a free hosting provider as https://mysite.hostingProvider.example.

While setting up the CNAME Record configuration on my domain name provider website, I see these fields.

  • Host: {What should be here, the default written is 'www'}
  • Value: mysite.hostingProvider.example
  • TTL: Automatic

I am confused what to put in 'Host' field as the free site is not accessible with www.mysite.hostingProvider.example.

  • Host field value is usually www or yourdomainname.com Keep your TTL to 3600 – Deepak Mathur Apr 13 at 13:47
2

Your free hosting site needs to support custom domain names. It isn't enough to point the DNS for your domain name to their server. You also need to tell your host about your domain name and they need to configure their server to show your site for requests for that domain name.

Not all free hosting supports custom domain names. In fact most free hosts don't.
I never use free hosting and I never recommend that anybody else does either. If you are willing to spend $15 a year registering a domain, you can find a reliable web host for $50 per year. As How to find web hosting that meets my requirements? says:

  • Free hosts have no obligation to offer you support.
  • Free hosts have no obligation to keep your site running.
  • Free hosts have little obligation to upgrade, maintain, and secure their servers.
  • Probably advertising on your site.

In short, it's worth paying for hosting instead of using a free service. A cheap shared hosting package will give you a basic level of support, more reliable uptime, and it won't break the bank.

A CNAME is not sufficient to show the same content as some other site. A CNAME is also not a redirect. A CNAME says that the subdomain of a domain uses the same IP address as another site. When you use www as the host name in your DNS CNAME configuration the client does these steps:

  1. The client looks up the DNS for www.example.com. It sees that it is CNAME for mysite.hostingProvider.example.
  2. The client does a DNS lookup for mysite.hostingProvider.example and gets an A record with an IP address. Say 123.123.123.123.
  3. The client opens an HTTP connection to 123.123.123.123 and sends a Host: www.example.com header as part of the request.
  4. The server has to be configured to respond with the content for www.example.com as opposed to the hundreds of other sites that it may be hosting. The server has no knowledge that the intermediary mysite.hostingProvider.example was used in the DNS lookup process.

So using www is correct for the CNAME, however, it isn't working because the hosting server isn't configured. You need to log into your web host and add that domain to your account. With most hosting that is done by configuring a domain or an "add-on domain" for your account. Your free hosting may or may not support these.

There is one other wrinkle. A CNAME cannot be used for the apex domain without any subdomain. You can't use a CNAME for example.com, only for www.example.com. If you want users to be able to type in the bare apex domain and get to your site, you need to configure A records with IP addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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