HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

/etc/hosts gets re-written by reboot

 
lshu
Frequent Advisor

/etc/hosts gets re-written by reboot

Hi,
The server is a HP-UX 11iv3 March 2009 release. When I changed /etc/hosts to add in domain name to its own IP and reboot the server, the entries modified are changed back:
in server hostname:/etc/hosts, it has
10.10.10.1 hostname
changed to
10.10.10.1 hostname.domain.com
after a reboot, it is changed back to
10.10.10.1 hostname

The IP entries for other hosts in /etc/hosts file are not impacted. Is it a feature that can be turned off?

Thank you for your time.
Lorne

4 REPLIES
Jeeshan
Honored Contributor

Re: /etc/hosts gets re-written by reboot

check the hostname entries using the following command

#set_parms hostname

If the above command shows the host name in hostname.domain.com than change the hostname from here. Not in /etc/hosts file.
a warrior never quits
Jeeshan
Honored Contributor

Re: /etc/hosts gets re-written by reboot

Actually the command "set_parms hostname" is Validates a user supplied hostname according to host naming conventions and sets various system initialization variables to operate with
that hostname.

Particularly, it edits /etc/hosts to associate the new hostname with the current IP address of the system, if that can be determined.
a warrior never quits
lshu
Frequent Advisor

Re: /etc/hosts gets re-written by reboot

Sorry not to describe the issue accurately. Here it is:
...
in server hostname:/etc/hosts, it was
10.10.10.1 hostname
changed to
10.10.10.1 hostname.domain.com hostname
I also tried
10.10.10.1 hostname hostname.domain.com
after a reboot, it is changed back to:
10.10.10.1 hostname

The hostname is set without domain.com.
thanks
Lorne
sujit kumar singh
Honored Contributor

Re: /etc/hosts gets re-written by reboot

hi

try setting the hostname using set_parms hostname , also see what changes this makes to /etc/rc.config.d/netconf.

please post the contents of /etc/hosts as well as /etc/rc.config.d/netconf

also on my system

both the files have ownerships as bin:bin

regards
sujit