Operating System - HP-UX
1752571 Members
5127 Online
108788 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