Saturday, July 8, 2017

domain name system - Can a CNAME record not include www?




My registrar tell me that I can't have a CNAME record that doesn't start with www. Is it true?



So I am using amazon ec2 with load balancing. the loadbalancer has a convoluted DNS name, and specifically tells you to use a CNAME to send requests to that DNS name, and not an A record.





myloadbalancer-1234567890.us-west-1.elb.amazonaws.com (A Record)



Note: Because the set of IP addresses associated with a LoadBalancer can change over time, you should never create an "A" record with any specific IP address. If you want to use a friendly DNS name for your load balancer instead of the name generated by the Elastic Load Balancing service, you should create a CNAME record for the LoadBalancer DNS name, or use Amazon Route 53 to create a hosted zone. For more information, see Using Domain Names With Elastic Load Balancing.




I purchased a domain. The registrar doesn't allow you to add records yourself, only by emailing them a request. So they set up a CNAME record



mydomain.org  SOA 111  whatever

www.mydomain.org CNAME 3596 myloadbalancer-1234567890.us-west-1.elb.amazonaws.com


when I asked them why it doesn't work with www, the registrar answered that there is a technical prohibition to make a CNAME record without www. Is it true, or are they incompetent/lying and I should switch registrars?


Answer



A CNAME (Alias) record points to an A (Host) record. You can create multiple CNAME records and point them to an A record. The most common CNAME record used is the subdomains www, which is supported by every provider. You can also use Route53 to create A or CNAME. it supports 'www'.



Cheers!!



Tested Solution :




Update - To solve your problem you can use route 53 to create an A record for the ELB using root domain such as 'example.com' and CNAME as www.example.com.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...