10

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?

ADTC
  • 8,999
  • 5
  • 68
  • 93
  • 1
    `ec2-myinstance1-112233445566` is not unique. How do you expect AWS to resolve it? You can have multiple instances with name as myinstance1. – helloV Jan 02 '16 at 07:01
  • 1
    Why don't you want to use Elastic IP addresses? – Matt Houser Jan 02 '16 at 07:10
  • 1
    **helloV,** I would think that AWS can easily enforce unique instance names within an account with the given account ID if I want a fixed public DNS, even if they don't do so as of now. **MattHouser,** isn't Elastic IP address a paid service? Besides, they warn you not to use it if you don't really need it because IPv4 addresses are a scarce resource. And I don't need a static IP address here. – ADTC Jan 02 '16 at 07:33
  • 1
    Elastic IPs are paid for only when held but go unused. So if you're using the IP address on your instance, it's free. Alternatively you can use Route 53 along with a small OS-level script. – Matt Houser Jan 02 '16 at 14:01

0 Answers0