Operating System - HP-UX
1832574 Members
5299 Online
110043 Solutions
New Discussion

Re: Max number of characters in the hostname, hp-ux ver 11.11

 
Silver_1
Regular Advisor

Max number of characters in the hostname, hp-ux ver 11.11

Hi,

What is the maximum number of characters in the hostname. Is it 8 ?

I gone through some hp links etc, it says i can have 64 characters but `uname -a` will only show 8....etc....

Any inputs !
Tx
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

I believe you can exceed 8 but it's generally recommended that you don't.


Pete

Pete
Alan Meyer_4
Respected Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

According to the set_parms command, the Hostname can contain no more than 63 characters and that uname will truncate to 8 characters.
" I may not be certified, but I am certifiable... "
David Child_1
Honored Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

Yes, hostname can be quite large, but uname is limited to 8 characters because its used by uucp and related programs. The uucp protocol calls for max 8 characters.

Just my opinion, but you should keep them both at 8 characters max. At one company I worked for they tried to implement a 15 character host name. True it afforded the chance to put all kinds of interesting information into the name, but in the end everyone hated it and it actually made things more difficult for us.

David
Devender Khatana
Honored Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

Hi,

As indicated above as well allthough it can be more than 8 characters it should not. It should be a simple unique name identifier for you and others to know what you are referring to rather then having name,ip,organization,location etc. within the hostname.

HTH,
Devender
Impossible itself mentions "I m possible"
Alan Meyer_4
Respected Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

But I have noticed tha SAM will not allow you to enter a System Name larger than 8 characters
" I may not be certified, but I am certifiable... "
Mel Burslan
Honored Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

yes, longer names can happen but you are haunted by the legacy of 8 characters when it comes to reality. If you keep them under 8 characters, life will be much simpler in the long run.
________________________________
UNIX because I majored in cryptology...
David Child_1
Honored Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

Alan,

I haven't verified this, but SAM probably takes into consideration the uname limit and keeps it simple. You would most likely need to go command line to have hostname > 8.

David
Alan Meyer_4
Respected Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

yes, the hostname command does allow >8. SAM, I've discovered does allow up to 9 actually. If you set the name with uname -S, you are limited to 8 or less.
" I may not be certified, but I am certifiable... "
Mahesh Kumar Malik
Honored Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

Hi Nair

Maximum no of characters in hostname are 8, but in Trusted Mode (hp-ux hardened) hostname can span upto 40 characters

Regards
Mahesh
vinod_25
Valued Contributor

Re: Max number of characters in the hostname, hp-ux ver 11.11

hi

1. As researched, no patch is available for HPUX 11.11 to fix this issue. I heard HPUX 11.31 will have uname supporting more than 8 characters.

2. http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000068695446

3. This is not tested but try it on a test server...what i got from MAN pages are sorted below...

from the MAN pages of uname(1):

Change the node name (system name) to nodename.
nodename is restricted to UTSLEN-1 characters (see uname(2)). See WARNINGS. Only users with appropriate privileges can use the -S option.

from the MAN pages of uname(2):

The utsname structure, defined in , is set up as
follows:

#define UTSLEN 9
#define SNLEN 15

char sysname[UTSLEN];
char nodename[UTSLEN];

_______________________________________



> setuname()
The setuname() system call sets the node name (system name), as returned in the nodename field of the utsname structure, to name, which has a length of namelen characters. This is usually executed by /sbin/init.d/hostname at system boot time. Names are limited to UTSLEN - 1 characters; UTSLEN is defined in .

The sethostname(
) system call sets the name of the host processor to name, which has a length of namelen characters. At system boot time sethostname() is normally executed by the hostname command (see hostname(1)) in the /sbin/init.d/hostname script. Host names are limited to MAXHOSTNAMELEN characters, as defined in
______________________________________

editin
g the entries in /usr/include/sys/utsname.h

# define _SYS_NMLN 9
# define UTSLEN _SYS_NMLN

you can change the _SYS_NMLN value to the desired nodename length + 1 ...

Try changing the system name...

try this on a test server before trying it on a production one... as this is not tested and are as per the MAN pages...

Good Luck

Vinod K