Making WWW. work for subdomain with no hosting?
We have a domain, example.com
for instance. In our DNS settings for this domain, we've created a forward for give.example.com
subdomain to redirect to another website which works great. (It's basically just an A record with give
as the host and the IP of the site we're redirecting to as the value).
However, if you try www.give.example.com
, it does not work. I've read that you can add a CNAME record to remedy this, but I can't figure out exactly what I need to add.
www.give.example.com
is exactly like give.example.com
in the DNS, but they are separate names, so once you put a record for give.example.com
that says nothing for www.give.example.com
(except in cases of delegations, which is not the case here).
So you need records for both, such as in your zonefile (or equivalent in any provider UI or API):
give A 192.0.2.42
www.give A 192.0.2.42
(you can use separate IP addresses as well, of course).
You can use a CNAME
if you prefer (and want/need the same IP address anyway for both), in any direction:
give A 192.0.2.42
www.give CNAME give
or
give CNAME www.give
www.give A 192.0.2.42
All names are written in relative fashion, so could work for any zone. If you need absolute names, remember to tackle .example.com.
(including final dot) to every names above.
buy some good quality links here
ReplyDelete