Operating System - HP-UX
1834704 Members
2777 Online
110069 Solutions
New Discussion

the hostname in /etc/hosts automatically changed after reboot

 
12345678_1
New Member

the hostname in /etc/hosts automatically changed after reboot

dear sirs:

sorry to bother you.

i dont know why the content in /etc/hosts had been changed automatically.
I have 3 NIC which ip as following:
nic0 192.168.0.1
nic1 10.10.0.1
nic2 10.10.1.100
the hostname is "HOSTA".

IN THE ”/etc/hosts“ file, I manually enter the following items.
-----------------------
192.168.0.1 HOSTA-HB
10.10.0.1 HOSTA-MGMT
10.10.1.100 HOSTA
-----------------------
BUT WHEN I reboot the system,all content had been modified to:

-------------------
192.168.0.1 HOSTA
10.10.0.1 HOSTA
10.10.1.100 HOSTA
-------------------
can any one kindly to tell me why?

thank you
4 REPLIES 4
AwadheshPandey
Honored Contributor

Re: the hostname in /etc/hosts automatically changed after reboot

use
#/sbin/set_parms hostname and reboot the system.
also you can modify
/etc/rc.config.d/netconf for the same purpose.

Cheers.
It's kind of fun to do the impossible
12345678_1
New Member

Re: the hostname in /etc/hosts automatically changed after reboot

sorry,i mean, I don't want this happen.

do i need some actions?
Ganesan R
Honored Contributor

Re: the hostname in /etc/hosts automatically changed after reboot

Hi,

I don't see any possibilities of /etc/hosts content changed during reboot except if you have some startup script written to do so.

Just to confirm, have you saved the file after you made the changes and before reboot?
Best wishes,

Ganesh.
12345678_1
New Member

Re: the hostname in /etc/hosts automatically changed after reboot

the changed content is limited at the hostname which related the NIC.

since this host have 3NIC, and each NIC had difference IP