Operating System - HP-UX
1830042 Members
2056 Online
109998 Solutions
New Discussion

hostname length limitation

 
SOLVED
Go to solution
Salvi Marco
New Member

hostname length limitation

Setting hostname of HP-UX length more than 8 digits I obtain the following results:

example

hostname=lab333444

the command:
#hostname
return
lab333444

but the command
#uname -s
return
HP-UX unknown B.11.11 U 9000/800 864950601 unlimited-user license

In addition I cannot use the CDE because I get
an error concerning a bad configuration of /etc/hosts (that is ok) or network parameter.
Anyone know if exists a patch for thi problem?

12 REPLIES 12
Dave Hutton
Honored Contributor

Re: hostname length limitation

You can try to use #setparams hostname.
That'll make sure that you get all the locations that would need to be changed all at once.

Dave
T G Manikandan
Honored Contributor

Re: hostname length limitation

hostname length is not recommended to be greater than 8 characters.

You cannot do that until you install a patch for that
Joseph Loo
Honored Contributor

Re: hostname length limitation

hi,

did you include an entry of the server name and ip address in the /etc/hosts?

by the way, it should be uname -a, right?

regards.
what you do not see does not mean you should not believe
T G Manikandan
Honored Contributor

Re: hostname length limitation

check this doc

If the hostname exceeds eight characters you will face the problems defined in doc

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063236997
Salvi Marco
New Member

Re: hostname length limitation

The network settings are all rigth.
I modified the following files

/etc/rc.config.d/netconf
/etc/hosts
Pete Randall
Outstanding Contributor

Re: hostname length limitation

You're seeing the difference between "hostname" and "uname". Hostname length can be set with MAXHOSTNAMELEN as defined in . However, the node name, returned by uname, is not allowed to exceed 8 characters. The resulting confusion can wreak havoc on your system. It's far simpler to keep system names to 8 or fewer characters.


Pete

Pete
Steven E. Protter
Exalted Contributor

Re: hostname length limitation

its a feature

hostname can't be more than 8 digits

you can be server.some.net

you can get longer domain names via DNS

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
Salvi Marco
New Member

Re: hostname length limitation

thanks a lot guys
Bill Hassell
Honored Contributor

Re: hostname length limitation

Note that the name used in DNS by other computers can be different than your local hostname. So you can have two names for your computer, one for networking and the other for uname (see man hostname). To set both of them, edit the file /etc/rc.config.d/netconf and add the undocumented variable NODENAME. NODENAME must be no more than 8 characters, but HOSTNAME can be up to 64 chars. So for your case:

HOSTNAME=lab333444
NODENAME=lb333444 (or whatever you want)

You can set hostname and uname without rebooting:

hostname lab333444
uname -S lb333444

but make sure you edit the netconf file so the change is permanent after a reboot.


Bill Hassell, sysadmin
Berlene Herren
Honored Contributor
Solution

Re: hostname length limitation

"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 ."

UTSLEN is #defined to _SYS_NMLN which is set to 9.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
derek b smith_1
Regular Advisor

Re: hostname length limitation

what is the patch name to go beyond 8 characters? I did look in params.h and yes 64 is the max but what is there a patch needed to go beyond 8 considering this variable in params.h?
does this apply to 11i as well?
thanks
derek
Bill Hassell
Honored Contributor

Re: hostname length limitation

AS mentioned in the URL above, adding the patch will BREAK a lot of programs. You don't want to change the hostname to more than 8 characters. Even the patch will not work until you create a file that is called something: ItakeFULLresponsibilityFORallTHEproblems

As mentioned above, the network name can be 64 characters long, but the uname value cannot be longer than 8 characters. Although not clearly defined in the netconf file, you must set NODENAME to an 8 character name and set HOSTNAME to anything you like up to 64 chars. This will usually be the name your system will have in DNS. Both NODENAME and HOSTNAME should be set in /etc/rc.config.d/netconf


Bill Hassell, sysadmin