Reputation: 612
I am hosting my main site on ec2 let’s say instance1, my domain is from go daddy so i put cloudflare nameserver on go daddy. now i have another installation on ec2 let’s say instance 2 and it is a subdomain. instance 1 and 2 have different IP’s how can i point my subdomain to instance 2? which records should i change in AWS and in cloudflare to achieve this?
My Cloudflare DNS added in Godaddy
NS lisa.ns.cloudflare.com
NS sid.ns.cloudflare.com
DNS setting in Cloudflare account
Type Name Value TTL
A mydomainname.com points to 13.232.XXX.XXX Automatic
CNAME test is an alias of mydomainname.com Automatic
CNAME www is an alias of mydomainname.com Automatic
TXT mydomainname.com ca3-b78797cee2b346558bf7a891ff5bd5daXX Automatic
Upvotes: 2
Views: 1911
Reputation: 857
You don't need to change any records in AWS, since you using Cloudflare as your DNS service.
Cloudflare gives you ability to modify DNS zone settings, add A, CNAME and other records.
Just obtain public IP for instance-2 from AWS console, login to Cloudflare, open you domain DNS zone editor and add A
record with name of your subdomain pointing to IP of a second instance.
UPDATE: in your cloudflare configuration it should look like:
Type Name Value TTL
A mydomainname.com points to 13.232.XXX.XXX Automatic
A subdomain points to 123.123.123.123 Automatic
CNAME test is an alias of mydomainname.com Automatic
CNAME www is an alias of mydomainname.com Automatic
TXT mydomainname.com ca3-b78797cee2b346558bf7a891ff5bd5daXX Automatic
Upvotes: 1