Thursday, July 16, 2015

Using CNAME to point to another domain to save IP addresses




I have one server which I'm hosting a handful of sites on.



Currently, each site has it's domain hosted by an independent provider and each has an A record pointing to the server's IP address.



But if I want to change the server in the future, I will have to go back an update each IP address in each DNS record.



Is it possible to use a CNAME record on each domain to point to another domain that I control directly?



This is so I can update the IP address in 1 place myself and not have to get all these other DNS providers to update their records separately?


Answer




That's exactly the point of a CNAME. A CNAME does not need to point to a DNS in the same zone, it can point to any DNS name registered with any nameserver.



What it means for your clients is an additional DNS lookup on the NS for the other host, but that's a tiny price to pay for the majority of websites on the internet.


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...