Operating System - HP-UX
1751894 Members
5210 Online
108783 Solutions
New Discussion юеВ

Re: /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 4
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