Question

domain with and without www

Posted April 12, 2013 45.4k 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?
1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
13 answers
KFSys November 4, 2020
Pinned Answer

Hello All,

Since this is a pretty big question, I’ll write an answer that covers all topics in the answer section.

DNS with DigitalOcean

Adding a domain you own to your DigitalOcean account lets you manage the domain’s DNS records with the control panel and API.

To set up a domain with DigitalOcean, you need to add it (and any of its existing DNS records) to the control panel. In order for those DNS settings to be picked up, you need to have DigitalOcean’s Nameservers configured on the Domain

ns1.digitalocean.com
ns2.digitalocean.com

To edit your Domain’s Nameservers, you need to access your account with your registrar. Basically, where you Domain was bought from. In there change the Nameservers of the domain to the ones mentioned. Once you do, all records you’ve added in your DigitalOcean’s account for that domain will start working.

Please note that, DNS propagation can take up to 48 hours in certain places so be patient.

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.

Submit an Answer