1837932 Members
2869 Online
110124 Solutions
New Discussion

long Machine Name

 
Ahmed_41
Super Advisor

long Machine Name

Dear All
i am having a very long mahine HPUX 11.11 name like abcdefghijk, i find my machine only named with 8 charcters of this name, i need to be able to use this long name, what files shall i change the name in it ???
i already did the hosts file with the Ip and the correct name (long one)i need, also the netconf file is configured with correct hostname i need to use (long one) can someone tell me how to do this ?
Thanks
6 REPLIES 6
bhavin asokan
Honored Contributor

Re: long Machine Name

hi,
the maximum length of a hostname is determined by MAXHOSTNAMELEN in /usr/include/sys/param.h. The default (on HPUX 11.11 ) is 64.
see the following links.it may solve your problem.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=364972

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=301546

regds,






Bill Hassell
Honored Contributor

Re: long Machine Name

There are two names for a Unix system Look at the man page for hostname and you'll see that uname is the UUCP name while hostname is used for modern TCP/IP networking. HP-UX is a standards-based system and uname must remain consistent with the standards. uname is defined as an 8-character (max) name as stated in the man page for hostname. Once a standard is changed, all sorts of problems with compatibility start showing up (can you say Windows?). Each man page documents the applicable standard(s) at the bottom.

Now hostname is limited to 64 characters but nodename (the value reported by uname) is limited to 8 characters. BOTH can be set by editing the /etc/rc.conig.d/netconf file and entering separate values for HOSTNAME and NODENAME:

HOSTNAME=max8char
NODENAME=maximum64characternames

The NODENAME value is what is used for LAN connections. If only HOSTNAME exists then NODENAME is set to HOSTNAME.


Bill Hassell, sysadmin
Stuart Abramson
Trusted Contributor

Re: long Machine Name

My experience has been that for practical matters, you just DON'T want to have long hostnames. Things start to NOT WORK, like for example swinstall -s verylonghostname:/depot just completely breaks down.

I NEVER do it.
Geoff Wild
Honored Contributor

Re: long Machine Name

See this recent post:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=780354

As I mention there, alias the long name in DNS, but keep the real hostname at 8 characters.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Bill Hassell
Honored Contributor

Re: long Machine Name

OOPS...big correction. I reversed the names for HOSTNAME and NODENAME. It should read as follows:

> NODENAME=max8char
> HOSTNAME=maximum64characternames

>The HOSTNAME value is what is used for LAN connections. If only HOSTNAME exists then NODENAME is set to HOSTNAME.

So the hostname command can return a long name while uname -n will show the value of NODENAME from the startup script. Some sysadmins will set HOSTNAME to a fully qualified domain name (ie, bigfoot.sasquatch.net) which works for most environments but can break some scripts...and the startup script actually removes everything to the right starting with the first dot:

> uname -S ${HOSTNAME%%.*}


Bill Hassell, sysadmin
Rick Garland
Honored Contributor

Re: long Machine Name

Don't forget about the scripts you are going to write or want to run.

My experience has been that long hostnames create more confusion and forgetfulness.
(What was the name of that system that has 64 characters in its name?)