Static host name in Amazon EC2 Linux

Posted on 2013-02-04
Last Modified: 2014-07-25
I have Linux image on Amazon EC2. The problem that I am facing is that when I install Oracle products, they use the private DNS and the next time I would restart the image it will not work.
I would like to setup a permanent host name.
I tried the option of Elastic ip address and the result remain the same.

Question by:tamirmilo
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 33

Accepted Solution

shalomc earned 500 total points
ID: 38854111
You need to set up the ORACLE_HOSTNAME environment variable at boot time.

export ORACLE_HOSTNAME=`wget -q -O -` 

add this to your startup script and see if this helps

Author Comment

ID: 38854844
Thank you very mach.
Before I try quick question: isn't the result of the expression above will result in a different value since the host name is different on every reboot?
Thank you.

Expert Comment

ID: 39420937
If you'll use elastic ip it stays the same after reboot. As well as public hostname.

Author Comment

ID: 40220424
I've requested that this question be deleted for the following reason:


Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Companies keep a much closer eye on costs today, so changing to new Technology – Microsoft Office 365 is the smartest move to take.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. Spend 30 short minutes with us to learn:   • Key questions to ask when considering a partnership to accelerate your business into the cloud • Pitfalls and mistakes other partners…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question