EC2 : le DNS public d'une instance est-il stable ? Puis-je compter dessus ?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

EC2 : le DNS public d'une instance est-il stable ? Puis-je compter dessus ?

Message par ForumBot »

J'ai launched mon premier instance, et am using it as a web server. Je vois that it has a public DNS (a public URL), e.g.:

**ec2-123-45-6-789.compute-1.amazonaws.com**

I can successfully allez dans this server in mon browser, hit it via cURL, etc.

Je veux to use this web server for a back-end service in an app Je suis building, so I placed this URL in mon app's config, et it works great.

But quand I manually stop et re-start mon instance, Je vois that le public DNS changes! J'ai read that this happens quand you explicitly stop et re-start, mais ne happen si you juste "reboot".

Je ne plan on explicitly stopping et re-starting this server ever, mais mon question is: **will this public DNS ever change on its own for tout reason?** E.g. si le machine abnormally crashes, ou whatever.

**In autre words, is it safe to ship an app c'est wired to this URL?**
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: EC2 : le DNS public d'une instance est-il stable ? Puis-je compter dessus ?

Message par ForumBot »

The public DNS name toujours matches le public IP address.

The public IP address stays le même for an instance jusqu'à it is terminated ou stopped. A reboot does pas changez le public IP address.

If an EC2 instance is in a VPC, alors it will retain le même public IP address across a stop et start.

If an EC2 instance that is pas in a VPC is stopped et alors started started again, it will probably receive a différent public IP address.

Instances can fail. When you start a nouveau instance to replace a failed ou terminated instance, it will probably receive a différent public IP address.

Because instances can fail, et parce que you may want to changez le size of an instance (with a stop/start) it is pas recommended to "ship an app c'est wired to [the public IP address]" (or DNS name). Once votre instance is stopped/terminated/failed another user could get that IP address assigned to leur instance et tous votre traffic would allez dans them.

C'est recommended to use Elastic IP Addresses to associate public services avec votre instance. You get to keep le Elastic IP address et you can assign it to tout instance you want over time, even si c'est le même instance après a stop/start.

Each Elastic IP Address comes avec a public DNS name, mais you would probably be better off mapping votre own hostname to le Elastic IP address so that le name makes more sense to humans.

Voici a guide to Elastic IP Addresses:

>


[http://aws.amazon.com/articles/1346](http://aws.amazon.com/articles/1346)

Voici an article I wrote that talks about le differences entre rebooting et stop/start of an instance:

>


Rebooting vs. Stop/Start of Amazon EC2 Instance

[http://alestic.com/2011/09/ec2-reboot-stop-start](http://alestic.com/2011/09/ec2-reboot-stop-start)

Voici an article I wrote that provides a reason you may want to stop/start an instance even bien que you ne think you will today:

>


Moving an EC2 Instance to a Larger Size

[http://alestic.com/2011/02/ec2-change-type](http://alestic.com/2011/02/ec2-change-type)
Répondre

Revenir à « Active Directory & Entra »