Static host name in Amazon EC2 Linux

Hello,
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.

Regards,
Tamir
tamirmiloAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
shalomcConnect With a Mentor CTOCommented:
You need to set up the ORACLE_HOSTNAME environment variable at boot time.

export ORACLE_HOSTNAME=`wget -q -O - http://169.254.169.254/latest/meta-data/public-hostname` 

add this to your startup script and see if this helps
0
 
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.
0
 
mpilarczykCommented:
If you'll use elastic ip it stays the same after reboot. As well as public hostname.
0
 
tamirmiloAuthor Commented:
I've requested that this question be deleted for the following reason:

cxxcxc
0
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.