domain with and without www

April 12, 2013 36.1k views
I've created two A records in DigitalOcean web DNS config it looks like this: @ XXX.XXX.XXX.XXX www.mysite.com XXX.XXX.XXX.XXX But only mysite.com (without www) is reacheable and i can ping it. nslookup also can't find www.mysite.com what should i do to enable www subdomain?
35 Answers
Another tech for this problem

hostname = www
ip address = xxx.xxx.xxx.xxx

will for me.
go to your dns control panel and add a new A record

hostname = www.mysite.com
ip adress = your droplet ip adres etc xxx.xxx.xxx.xxx

and be sure nameservers are configured for digitalocen at your domain control panel
Maybe using the CNAME will be better solution, especially for search engines?
"www mysite.com" or "www @"
thanks. solved it with cname: www @
Name Only valid hostname characters are allowed. (a-z, A-Z, 0-9, ., _ and -) Or a single record of '@'. and Data CNAMEs can not be pointed to IP address, only domain names
Got that error when trying to set a CNAME record with both:
www IP and www.example.com IP

I could only set an A record with www.example.com IP but still not working www.example.com.

I ran into this same issue and after combining a couple of the answers above, your DNS configuration for example.com should be (with CNAME solving the www. issue):

A –> @ –> IP ADDRESS
CNAME –> * –> example.com.
NS –> ns1.digitalocean.com.
NS –> ns2.digitalocean.com.
NS –> ns3.digitalocean.com.

For google its 2 terms… always use proper webmaster guidelines.

I ran into this same issue and after combining a couple of the answers above, your DNS configuration for example.com should be (with CNAME solving the www. issue):

A –> @ –> IP ADDRESS
CNAME –> * –> example.com.
NS –> ns1.digitalocean.com.
NS –> ns2.digitalocean.com.
NS –> ns3.digitalocean.com.

I am facing the same problem as you. I did everything in the tutorial and nothing seems to work. But I wait like an HOUR for this and then it works properly.

So this was my configuration, just as the tutorial in digitalocean here in the “CNAME” section

Enter Name: www

Enter Hostname: @

Hope it helps!!

PD: My droplet has this example name: example.com (or .net if your domain is .net, etc)

We also faced the same problem. What we did was added a page rule using Cloudflare to force non www version to www and it worked like a charm.

edited by MattIPv4

go to your DNS control panel and add a new A record.

Have another answer? Share your knowledge.