Static host name in Amazon EC2 Linux

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.

Who is Participating?

Improve company productivity with a Business Account.Sign Up

shalomcConnect With a Mentor CTOCommented:
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
tamirmiloAuthor Commented:
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.
If you'll use elastic ip it stays the same after reboot. As well as public hostname.
tamirmiloAuthor Commented:
I've requested that this question be deleted for the following reason:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.