What is the difference between a CNAME and a Subdomain?I understand that the a cname (the left side of a domain) can point to the domain, so you can two different urls point to the same address, ie.ex1.mydomain.com - if setup as a CNAME can return the IP of mydomain.comIf ex1.mydomain.com is setup as a subdomain, does it have a different IP?Another question is what should the ideal setup be in this situation:I have IP1:80 for a web appI have IP2:80 for another appCan I point both of these IPs to the same A record, with perhaps a different cname or subdomain?Thanks for any help?
Difference between CNAME and SUBDOMAIN
dns;subdomain;cname
A CNAME is a type of DNS record, where a hostname points at another hostname. An A record is another type of DNS record, where a hostname points at an IP address.A subdomain is what you described as 'the left side of the domain', e.g. webmasters.stackexchange.com is a subdomain of stackexchange.com. The DNS setup for a subdomain could use either an A record or a CNAME.Your question:Can I point both of these IPs to the same A record, with perhaps a different cname or subdomain?doesn't really make sense. You don't point IPs at A records, you point hostnames at IPs using A records. If you're asking if you could point a domain and a subdomain at the same IP, the answer is yes.This might be clearer with a real world example:webmasters.stackexchange.com has an A record that points to the IP 198.252.206.140.stackexchange.com also has an A record that points to the IP 198.252.206.140.It would therefore be possible to change webmasters.stackexchange.com to CNAME to stackexchange.com, and everything would continue to work as it does now.(In practice, CNAMES are slightly slower than A records as they might result in an additional DNS lookup, so that's one reason why A records are more commonly used.)