DigitalOcean DNS - Where is the Redirect/ALIAS DNS Record?

February 11, 2015 12.8k views

I'm trying to redirect www. URL to non-www. but I do not see a Redirect or ALIAS DNS record option any where. How can I redirect my website/app using DNS?

  • FYI: There is no such thing as a Redirct nor an ALIAS DNS record. It's more of a creative workaround a DNS operator may or may not provide server side.

  • If that is the case, what is the work around to create a redirect?

2 Answers

As @andol mentioned, ALIAS records are not really an industry standard.

If you wanted to set up a redirect from one domain to another yourself, you can point an A record for both domains to same server. Then perform the redirect using Apache or Nginx:

by Justin Ellingwood
HTTP redirects are used to redirect web site visitors to new locations when they request content. These are useful for a variety of reasons, whether permanent or temporary. This guide will demonstrate how to redirect visitors using Apache and Nginx.
  • It might be better to add a CNAME to the domain you want to redirect so that you can move the new domain to a new server and only have to change the A record for the new domain.

there's no the way then redirect for your purpose.

you have to set redirect on your web server level.

if you dont want to touch web server then you can use cloudflare page rule option. in that case you have to use cloudflare but i would recomend you to go for the first option (webserver)

Have another answer? Share your knowledge.