Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route website to subdomain in digitalocean

I'm trying to route a subdomain media.xyz.com to another droplet in digialocean. My main domain xyz.com points to a different server correctly.

My zone record looks like this

@   IN A    107.170.51.xx
www CNAME   @
media   IN A    107.170.52.xx

However this does not work and the sub domain (media.xyz.com) redirects to my main webserver.

I've read the digital ocean tutorial on this and I think I've set it up correctly. I've also looked over questions on SO and the general advice is to create a new A record.

Could anyone tell me if this approach should work..? Or is my understanding on how this should work incorrect..?

like image 618
Jim Avatar asked Dec 19 '22 17:12

Jim


1 Answers

you need to add record for your subdomain like what explained here:

https://www.digitalocean.com/community/articles/how-to-set-up-and-test-dns-subdomains-with-digitalocean-s-dns-panel

so simply in your DO control panel under your domain, do the following:

Add A record --> write down your subdomain end up with dot like this: media.xyz.com.

and your droplet IP in the 2nd field next to that: 107.170.51.xx

try that and see if it works or not!!

like image 66
Digital site Avatar answered Dec 27 '22 03:12

Digital site