Note that I do not want AWS to assign a static IP address to my EC2 instance. Kindly take time to read the question.
I'm fine with Amazon AWS assigning a new IP address every time I stop and start my EC2 instance. However, Amazon AWS also assigns a public DNS host name based on this IP address. This completely defeats the purpose of having a hostname in the first place, because a host name is supposed to help you locate the server even if its IP address has changed.
For example, if the IP address is 12.34.56.78
, AWS assigns a public DNS name as follows:
ec2-12-34-56-78.ap-location-1.compute.amazonaws.com
I had assumed that there would be an option to get a fixed public DNS that Amazon can internally resolve to the correct instance, like my imaginative example:
ec2-myinstance1-112233445566.ap-location-1.compute.amazonaws.com
Where myinstance1
is the name of my instance as I have defined in the EC2 console, and 112233445566
is my account ID.
This way, even if the public IP address changed to 23.45.67.89
, the public DNS would remain exactly the same as it's based on fixed details.
I noted that a similar set-up is possible using an external third party service called "No-IP". But this creates external dependency and requires configuration at the operating system level in the instance, to start a daemon service to do the updating. It also sounds like there may be delay between IP address change at AWS end, and corresponding update at No-IP end. (Tried it, and it gives a short and neat address like myhostname.ddns.net
. This should work for now, and the OS level configuration was quite straightforward and easy.)
But Amazon AWS should be able to manage this internally anyway (since the instance identifier is a sub-sub-sub-domain of amazonaws.com
), with absolutely no change in the instance operating system itself.
Why don't they offer this option? Is going with No-IP or a similar third party service the only way here? Or am I not finding a hidden treasure?