Different hostnames with reboot while lan cable, no lan cable

I am facing strange problem regarding hostname on my Linux(2.6.18-164.el5xen x86_64 GNU/Linux), the hostname changes if reboot with lan cable and with NO lan cable

Reboot with lan cable:

  1. The hostname is ubunut
  2. Unable to connect Oracle database using sqlplus some times database is not started due to ORA-00600 error : internal error code, arguments: [keltnfy-ldmInit],[46],[1],[],[],[]
  3. If I change the hostname to localhost then able to start the database.
  4. Able to browse internet.

Reboot with no lan cable:

  1. hostname is localhost.localdomain,
  2. Oracle database started.
  3. Connected lan cable later but unable to browse internet( changed hostname as ubuntu , even though unable to connect to internet)

In both above two cases
/etc/hosts file has the blow entry:
127.0.0.1 localhost.localdomain localhost
/etc/syscinfig/network file has the below entry:
HOSTNAME=localhost.localdomain

To conclude , there are two issues, if the hostname is ubuntu unable to start database , if lan cable is connected after the reboot then unable to browse internet.

My system has two partintions, one is for windows, other one is for linux.
The windows partion also has ubuntu virtual machine.
Is this ubuntu vm is causing any issue while rebooting to linux portion while lan cable is connected?

Please suggestme to solve these issues,

Thanks

Check if hostname is picked from dhcp when network cord connected..

The issue has been resolved after changing the default hostname to some other name as below:
/etc/hosts file has been modified as:
127.0.0.1 myhost

/etc/syscinfig/network file has been modified as :
HOSTNAME=myhost

thank you