Jump to content
 English      
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
     Forums advanced search
HP.com Home
IT Resource Center Forums > HP-UX > system administration

increasing max length of uname

» 

IT Resource Center

» Login
» Register
» My profile
» Search knowledge base
» Forums
» Patch database
» Download drivers, software and firmware
» Warranty check
» Support Case Manager
» Software Update Manager
» Training and Education
» More maintenance and support options
» Online help
» Site map

Member icons
 
 HP moderator  HP moderator
 Expert in this area  Expert in this area
Member status
ITRC Pro ITRC Pro
250 points
ITRC Graduate ITRC Graduate
500 points
ITRC Wizard ITRC Wizard
1000 points
ITRC Royalty ITRC Royalty
2500 points
ITRC Pharaoh ITRC Pharaoh
7500 points
Olympian Olympian
20000 points
1-Star Olympian 1-Star Olympian
40000 points
2-Star Olympian 2-Star Olympian
80000 points
»  How to earn points
»  Support forums FAQs
Question status
Magical answer Magical answer
Message with a response that solved the author's question
Favorites status
Add to my favorites Add to my favorites
Delete from my favorites Delete from my favorites
This thread has been closed Thread closed
 

Content starts here
   Create a new message    Receive e-mail notification if a new reply is posted  Reply to this message
Author Subject: increasing max length of uname      Add to my favorites
Larry Schauer Expert in this area
Jan 24, 2002 01:00:28 GMT   

The default max length for uname is 8 characters. The uname man page says this value if UTSLEN - 1, which is found in sys/utsname.h. I changed the value of "_SYS_NMLN" in this file to 64, recompiled the kernel, and rebooted, but I still cannot set the uname to a length greater than 8.

The underlying problem we are trying to solve is this: Our host naming scheme requires hostnames longer than 8 characters, and we want the hostname and nodename to be the same (as recommended by the man page).

Thanks,
Larry Schaue
Note: If you are the author of this question and wish to assign points to any of the answers, please login first.For more information on assigning points ,click here


Sort Answers By: Date or Points
Bill Hassell Expert in this area This member has accumulated 40000 or more points
Jan 24, 2002 01:14:56 GMT  2 pts

uname -n is NOT the hostname, it is the UUCP nodename and cannot be larger than 8 characters. The hostname and uname are (by default) set equal equal to each other, but there is a (poorly documented) way to specify a long hostname:

Edit the file: /etc/rc.config.d/netconf and locate the line:

HOSTNAME="goofy"

Add a new line:

NODENAME="goofy"

and change HOSTNAME to:

HOSTNAME="goofythegreat"

or whatever.

Now be sure to edit /etc/hosts to include the short uname and the long hostname (as well as the FQDN or fully qualified domain name) appear in /etc/hosts.

Then to avoid delays and problems with DNS, edit gthe /etc/nsswitch.conf file and change the hosts: line to read

hosts: files[NOTFOUND=continue UNAVAIL=continue] dns

This ensure high reliability (in case of a DNS failure) and low network load for unnecessary DNS requests.

Now your system is ready to reboot, but if you want to verify that all is well, you can make the changes by hand too:

uname -S goofy
hostname goofythegreat
Larry Schauer Expert in this area
Jan 24, 2002 13:37:37 GMT    N/A: Question Author

Bill,
Thanks for the response. I know that uname is the nodename (and not the hostname), but I want the hostname = nodename (since many programs use 'uname -n' instead of 'hostname' to determine the hostname). According to the man page for 'uname', I *should* be able to increase the length of the nodename (UTSLEN - 1). But changing sys/utsname.h and recompiling the kernel doesn't seem to work. What is the proper way to change this?

Thanks, Larry
Larry Schauer Expert in this area
Jan 28, 2002 18:35:54 GMT    N/A: Question Author

Just following up on my earlier question. Does anyone have an answer or some ideas? Solaris supports nodenames of longer than 8 characters, so I would assume that HP-UX would support it as well. I noticed that HP-UX 11.0 has the same header file entry.

Thanks in advance,
Larry
T. M. Louah Expert in this area This member has accumulated 1000 or more points
Jan 28, 2002 18:41:48 GMT  2 pts

Here's an interesting discussion about hostname greater than 8 chars:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xeecad06ed8c8d4118fef0090279cd0f9,00.html

g'd luck
t++
Larry Schauer Expert in this area
Jan 28, 2002 19:27:05 GMT    N/A: Question Author

TM,
Thanks for the info. Unfortunately it does not help solve my problem. I know that the hostname can be longer than 8 chars (and have tested it). I want to increase the NODENAME to more than 8 chars. I see two likely scenarios (although others are possible):

1. We must recompile the setuname binary (and maybe uname) for the change in UTSLEN to take effect.

2. The solution is to recompile the kernel, but we did not do this correctly (a possibility, but we used SAM).

3. The man page for uname is incorrect: The nodename is NOT based on UTSLEN-1, but is always '8'.

There are probably other possibilites. I'm just looking for the solution: How to make the nodename longer than 8 chars.

Thanks,
Larr
 
Create a new message    Receive e-mail notification if a new reply is posted   Reply to this message
 
 
Printable version
Privacy statement Using this site means you accept its terms
© 2009 Hewlett-Packard Development Company, L.P.