Operating System - HP-UX
1833758 Members
3067 Online
110063 Solutions
New Discussion

Confilict between nodename and hostname

 
amit mehta_2
Regular Advisor

Confilict between nodename and hostname

Hi,

I was just wondering that what could be the effect of setting differnet "nodename" and "hostname" for an HP box.
i can alter the hostname using,
set_parms hostname
and can change the nodename using,
setuname -n

~amit
8 REPLIES 8
Peter Godron
Honored Contributor

Re: Confilict between nodename and hostname

Amit,
Not sure why you would want to, but you could also edit the /etc/rc.config.d/netconf file and add NODENAME parameter.

Impact is best explained in "man 1m setuname" "man hostname" and "man 5 hostname"


amit mehta_2
Regular Advisor

Re: Confilict between nodename and hostname

Hi Peter,

Are these (i.e. "set_parms hostname" and "setuname" ) just two different interfaces for changing the hostname/nodename ?

~amit
Peter Godron
Honored Contributor

Re: Confilict between nodename and hostname

Amit,
two different naming entities.

Hostname is used in a number of locations/programs. Nodename is used mainly by uname -a . It does become clearer, once you have read the man pages ;-)
Yogeeraj_1
Honored Contributor

Re: Confilict between nodename and hostname

hi Amit,

it would be like creating two aliases for the same ip address in the /etc/hosts file.

Having different values for nodename and hostname is not something i would recommend, unless you have good reasons for doing so.

If you have observed such an anomaly, you should investigate further and correct it if need be...

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
amit mehta_2
Regular Advisor

Re: Confilict between nodename and hostname

Hi Peter,

My investigation so far:
Excerpt from 1M setuname:
The size of the name and node is limited to UTSLEN-1 characters. <------
UTSLEN is defined in . Only users having appropriate privileges can use this command.

so i looked into /usr/include/sys/utsname.h
and i found following macros defined(rest not mentioned here)
#define __SYS_NMLN_V2 257 <---
#define __SYS_NMLN_V1 9 <---
#define __SNLEN_V2 257
#define __SNLEN_V1 15
# define UTSLEN _SYS_NMLN

#if (_INCLUDE_HPUX_API_LEVEL < 20040821)
#define _SYS_NMLN __SYS_NMLN_V1
#else /* _INCLUDE_HPUX_API_LEVEL >= 20040821 */
#define _SYS_NMLN __SYS_NMLN_V2

Entry in /usr/include/sys/stdsyms.h
#ifdef _HPUX_API_LEVEL
# if _HPUX_API_LEVEL == 20040821
# define _INCLUDE_HPUX_API_LEVEL 20040821
# elif _HPUX_API_LEVEL == 0
# define _INCLUDE_HPUX_API_LEVEL 0
# else /* _HPUX_API_LEVEL != 0 && _HPUX_API_LEVEL != 20040821 */
error "Invalid value for _HPUX_API_LEVEL"
# endif /* _HPUX_API_LEVEL != 0 && _HPUX_API_LEVEL != 20040821 */
#else
# define _INCLUDE_HPUX_API_LEVEL 0


so what i deduce from all above is as follows:
The nodename can be maximum of 8 characters if the macro _HPUX_API_LEVEL is set to
"20040821" else the nodename can be maximum of 256 charcters.Please correct me if i am wrong.

Thanks for pointing me to corrosponding Man pages.

~amit
Peter Godron
Honored Contributor

Re: Confilict between nodename and hostname

amit mehta_2
Regular Advisor

Re: Confilict between nodename and hostname

Thanks Peter for giving me pointers.

amit mehta_2
Regular Advisor

Re: Confilict between nodename and hostname

Closing the thread as i found what i was looking for.