scasic
By:
scasic

domain with and without www

April 12, 2013 16.2k 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?
9 Answers

Well i have to say that i have the same problem as you and it was a headache, because i did everything in the tutorial and nothing seems to work BUT!!! i wait like an HOUR for this and then it work properly.

So this was my configuration, just as the tutorial in digitalocean here in the "CNAME" section http://bit.ly/1DL7ue3

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)

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.

I am also getting same issue. My site not working without www.

Have another answer? Share your knowledge.