ec2: assign cname to elastic ip
CNAME resource records specify a domain as an alias of another canonical domain name. As such, it cannot point to an IP address.
A and AAAA records define the canonical name and point to IP addresses. CNAMEs must reference those.
Create an A record for allehotelsinparijs.nl
that points to 79.125.111.73
. Then create a CNAME record for www.allehotelsinparijs.nl
that points to allehotelsinparijs.nl
.
Then in your webserver on the EC2 server, create a vhost for allehotelsinparijs.nl
that does a 301 redirect to www.allehotelsinparijs.nl. Details of how to do this are out of scope for this question, but there are many examples to be found here on Serverfault and elsewhere.
You may prefer to make the CNAME point to the AMAZON Elastic IP's DNS name.
eg. allehotelsinparijs.nl as CNAME to ec2-79-125-111-73.compute-1.amazonaws.com (may NOT be the actual amazon hostname)
The benefit from doing this is that externally your hostname will resolve to a public IP, but internal to Amazon, it will resolve to an PRIVTE IP for your instance.
(this will make calls to your site more direct and possibly cheaper when inside AWS)