By batornator
I have set up my DNS and all appeared to be working fine, I have 2 sites hosted on my server using virtual hosts and going to either http://domain1.com or http://domain2.com works. However going to http://www.domain1.com or http://www.domain2.com does not. I have set up both a wildcard and www CNAME in the hopes of fixing it but it still doesn’t work.
My droplet is running CentOS 6 and apache, I have copy/pasted the info i have on the dns control panel below with the ip/domains removed. Any help or pointers to where I’m going wrong would be great!
A @ xxx.xxx.xxx.xxx
CNAME www @
CNAME * @
Zone File
$TTL 1800 @ IN SOA NS1.DIGITALOCEAN.COM. hostmaster.mydomain.com. ( 1409133661 ; last update: 2014-08-27 10:01:01 UTC 3600 ; refresh 900 ; retry 1209600 ; expire 1800 ; ttl ) IN NS NS1.DIGITALOCEAN.COM. NS NS2.DIGITALOCEAN.COM. NS NS3.DIGITALOCEAN.COM. @ IN A xxx.xxx.xxx.xxx
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This comment has been deleted
Hi !
I could see your DNS question, and I may give you a few help to check what is going on.
Using a CNAME records in DNS presumes that you are pointing to a Fully Qualified Domain Name, as it is a record used to point to Canonical Names only.
In your typical case, you are trying to point a CNAME to your domain ‘@’ which can only point an IP. As far as I know that kind of records, I would not use that kind of CNAME in my DNS zone file.
You can solve this issue in 2 ways :
You could point the ‘www’ subdomain to the PTR record of your IP address, and match the FQDN requirements to use a CNAME in your record. The digitalocean admin panel allows you to do so once you’ve booted a container, and this could be the solution
You could use a second A record to point your ‘www’ subdomain to the same IP as your domain. This solution is less sexy as it will need you update your DNS zone file twice each time an IP changes in your design. But this is an acceptable solution if you don’t want to fix PTR for all the containers you will create in DigitalOcean admin panel.
I hope this information could help you. Feel free to let me knows if it was OK to issue your case ;)
Best regards,
– rustx
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.