On AWS EC2 instances, the hostname is typically configured automatically based on the private IPv4 address of the instance. Customers may need to set a custom hostname and ensure it persists during instance recycle or replacement. This article provides steps to configure a custom hostname and maintain it across reboots.
-
Edit the host files to set a permanent hostname:
sudo gedit /etc/hostname /etc/hosts -
Obtain the instance IP using instance metadata:
-
After configuring the desired hostname, update the user data script to include these commands. This ensures the configuration executes during each boot and persists across replacements.
-
When IP persistence is enabled, the custom hostname is often maintained during replacements because the hostname is linked to the persistent IP. If IP persistence is not configured, the hostname will not be maintained automatically.
-
For additional details on setting a static hostname in Linux (RHEL 7, CentOS 7), refer to the official AWS documentation:
AWS Knowledge Center: Configure static hostname.
Outcome
The hostname remains consistent during instance recycle or replacement on AWS stateful nodes.
Related Articles
Why revert to spot occurs outside configured hours in Azure Stateful nodes 19Number of Views Remove a stateful node from Flexera management and manage it in AWS 16Number of Views Increase disk size for Azure stateful nodes 5Number of Views Convert a stateful node into a stateful Elastigroup 5Number of Views Use a static hostname for AWS instances 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago