Operating System - HP-UX
1833540 Members
2756 Online
110061 Solutions
New Discussion

Re: hostname more than 8 characters

 
vaibhav_1
Occasional Advisor

hostname more than 8 characters

I want to have my hostname of more than 8 character . In hostname I get correct hostname.
But in Uname -a command it gives on 8 characters. Is there is any way we can get the
complete hostname in "uname" command .
vaibhav
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: hostname more than 8 characters

You can't have it.

Check out /usr/include/sys/utsname.h where UTSLEN is limited to 9. setuname() call
sets the nodename with the size being "namelen" equal to UTSLEN -1 = 8.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Patrick Wallek
Honored Contributor

Re: hostname more than 8 characters

Sachin Patel
Honored Contributor

Re: hostname more than 8 characters

Hi Vaibhav,
No NO NO. don't do it. You are asking for lots of trouble and grief.

Sachin
Is photography a hobby or another way to spend $
John Bolene
Honored Contributor

Re: hostname more than 8 characters

There is lots you can do in 8 chars to describe the system and keep it unique in your organization.

We use 2 chars for country code, 3 chars for system type (dfs - data file server, xts - xterm server, etc) and 3 chars for a number.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com