How to add www subdomain

November 14, 2013 9.2k views
I bought a domain from namecheap.com and set up my domain (conceptgrapher.org) for a droplet running ubuntu 12.04. I have an nginx server listening on port 80 in the droplet. I'm now able to access conceptgrapher.org from the browser, but I also want to access www.conceptgrapher.org After some googling I found http://support.godaddy.com/groups/dns-management-and-services/forum/topic/adding-www-to-my-domain-name/ According to my understanding I need to add a CNAME record. So I added a CNAME from the DNS tab in the cloud.digitalocean.com console: Enter Name: www Enter hostname: conceptgrapher.org. (with a '.' in the end) I've attached a screenshot of the values I entered too: http://imgur.com/1REv6rO But www.conceptgrapher.org remains unresolved: $ nslookup www.conceptgrapher.org Server: 127.0.0.1 Address: 127.0.0.1#53 ** server can't find www.conceptgrapher.org: NXDOMAIN But just conceptgrapher.org works fine $ nslookup conceptgrapher.org Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: Name: conceptgrapher.org Address: 146.185.175.174 How to resolve the issue? Thanks!
1 comment
2 Answers
;; QUESTION SECTION:
;www.conceptgrapher.org. IN A

;; ANSWER SECTION:
www.conceptgrapher.org. 1800 IN CNAME conceptgrapher.org.
conceptgrapher.org. 1800 IN A 146.185.175.174

Looks OK to me. Wait for your local cache to expire.
I looked at https://www.digitalocean.com/community/articles/how-to-set-up-a-host-name-with-digitalocean
and solved the issue for now.

I had to add an A record instead of a CNAME.

Also see http://stackoverflow.com/questions/2861372/mydomain-com-a-record-or-cname
by Etel Sverdlov
This article walks you through setting up the DNS for your site. The tutorial includes steps to set up an A records, point your nameservers, and provides some information about MX records.
Have another answer? Share your knowledge.