Operating System - HP-UX
1851750 Members
2195 Online
104062 Solutions
New Discussion

Re: Regarding hostname magic!!

 
Yogesh M Puranik
Valued Contributor

Regarding hostname magic!!


Hi All,

For my HP-UX 11.23 U ia64 box,I have changed
my hostname as "vigilance2".

When I run hostname command it gives proper output as "vigilance2".But when I give uname -a or uname -n , it is showing as "unknown".

Can anybody help me out in this scenario,what could be the area where i need to make change.Or weather it is because of more than 8 character i am using for host name.Below is the actual snapshot from the server.

vigilance2 #
vigilance2 # hostname
vigilance2
vigilance2 # uname -n
unknown


Any help will appreciable!! many thanks.

Rgds,

-Yogesh


8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Regarding hostname magic!!

The simplest, most complete way to successfully change a host name in all the locations it needs to be changed is to run "/sbin/set_parms hostname".


Pete

Pete
Jose Mosquera
Honored Contributor

Re: Regarding hostname magic!!

Hi,

Pls ensure these:
1.- In /etc/hosts file:
127.0.0.1 localhost loopback

2.- Configure appropriately your /etc/resolv.conf:
search
nameserver

3.- Configure appropriately your resolution rule into /etc/nsswitch.conf, i.e:
hosts: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=return]

Rgds.
Dennis Handly
Acclaimed Contributor

Re: Regarding hostname magic!!

>Or whether it is because of more than 8 character i am using for hostname.

Very possibly. Though I would have thought it would truncate?
Note the scary WARNINGS under uname(1).
Yogesh M Puranik
Valued Contributor

Re: Regarding hostname magic!!


Thanks everybody for great help!!


Hi Pete!!

Yah , in /sbin/set_parms hostname is showing as unknown please refer the below snapshot!!


# Reset hostname to what's expected at this point. May be unnecessary...
hostname unknown

So, you mean to say i need put my hostname instead of "unknown". But i am quite afraid that whether it require reboot after changing parameter??

Please let me!!

Thanks!!

Rgds

Yogesh



Steven E. Protter
Exalted Contributor

Re: Regarding hostname magic!!

Shalom Yogesh,

http://software.hp.com has an extension for 11i v2 that permits host names longer than 8 digits.

I wouldn't use it but if you MUST have eight characters go ahead.

I built a system in 2002 with the name jerusalem and got the exact same results as you. The OS can't handle it without the add in. I was forced to change the hostname because serious issues existed and scripts that used uname broke.

SEP

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: Regarding hostname magic!!

Hi Yogesh:

You don't say how you changed your hostname.

Normally, you define the variable 'HOSTNAME' in '/etc/rc.config.d/netconf' and leave the variable 'NODENAME' undefined. This is by default what '/sbin/set_parms' will do.

During startup (after a reboot), when '/sbin/init.d/hostname' runs, if 'NODENAME' is empty (or undefined) then 'uname -s' is run with the value of HOSTNAME to set it to be the same as the HOSTNAME or to the first string of characters before a dot ('.').

Regards!

...JRF...
Yogesh M Puranik
Valued Contributor

Re: Regarding hostname magic!!


Thanks everyvody!!


Well James!! thanks for reply.I need to give you the update that hostname and other details, i have already set properly in /etc/rc.config.d /netconf file.Moreover i dont have the parameter "NODENAME" under this file.So no question of keep it empty.Below are the actual details from the server.


HOSTNAME="vigilance2"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1



INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]="10.0.xx.xx"
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0
INTERFACE_MODULES[0]=""

DEFAULT_INTERFACE_MODULES=""
ROUTE_GATEWAY[0]=10.0.xx.xx
ROUTE_COUNT[0]=1
ROUTE_DESTINATION[0]=default


rgds
Yogesh


Yogesh M Puranik
Valued Contributor

Re: Regarding hostname magic!!

Thnx everybody!!