Is it possible to use a static private DNS name to route within VPC to correct instance under ELB

0

Hi I am a bit rusty on AWS (been using another cloud provider for years) so please excuse any confused terminology. We are using ELB in front of a number of ec2 instances, and we want to make calls between them, ideally by name rather than IP, and without traffic going outside our VPC. Because our IPs are dynamic and also the DNS names relate to the IPs, if we put the private DNS name in our config we risk having to change it if we reboot anything.

Is there a concept of somehow allocating a fixed private dns name (e.g. widget.somename.private) which will always resolve to the correct instance of widget within the VPC and regardless of IP address changing? Or is there a way of changing our setup to achieve this?

Thanks

asked 9 months ago253 views
1 Answer
0
Accepted Answer

Is there a reason for the private IPs being dynamic? If not, you could assign them fixed private IPs and resolve them via DNS using a Route 53 private hosted zone assigned to your VPC. This requires enableDnsHostnames and enableDnsSupport settings enabled in your VPC.

profile pictureAWS
answered 9 months ago
profile picture
EXPERT
reviewed 9 months ago
profile picture
EXPERT
reviewed 9 months ago
  • I believe private IP's never change for existing EC2's, only public IP's do on a stop start.

  • Thank you, that is really useful. Gary - I think you are right re: private IPs but I should perhaps have clarified we also would rather also not have to change config if the EC2 is destroyed and recreated

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions