Please view my current DNS set up: link to set-up
I want to have subdomain: blog.mydomain.com and I want all requests to mydomain.com to be forwarded to blog.mydomain.com.
The result being whether you provided the blog subdomain or not you are taken to the blog.subdomain.com so the user knows that they are viewing the blog.
I have tried creating an A record and a CNAME record. Neither work.
For a CNAME if I set the name “@” and the hostname “blog.” I get the error: cname records cannot share a name with other records.
Do I need a differently configured CNAME record or an A record?
Thanks, Tom
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!
Did you just want to redirect all http traffic to blog.yourdomain.com? One method to do this is to create a catch-all DNS entry and then create a virtual host (or server block) with your webserver. For DNS
CNAME * yourdomain.com.
Note the period at the end above when entering the record in the DO control panel.
Search the tutorials to match your distribution and webserver; search for the string “virtual host”. In your case, set the default virtual host or server block to handle blog.yourdomain.com.
If you want requests for other domains to be redirected to blog.mydomain.com (i.e. the user always sees ‘blog.mydomain.com’ in their url bar), then you need to set up a 301 redirect. This is accomplished via your web server. Let me know what server you are using, and I’ll show you how.
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.