Operating System - HP-UX
1833053 Members
2592 Online
110049 Solutions
New Discussion

Re: How to support more than 8 characters for hostname in HP-UX 11.0

 
jh_yang
Advisor

How to support more than 8 characters for hostname in HP-UX 11.0

Hi, all:

I haven't tried it. I don't know if it's supported or not. If supported, how to make the change?

Thanks
8 REPLIES 8
S.K. Chan
Honored Contributor

Re: How to support more than 8 characters for hostname in HP-UX 11.0

Say you want kilimanjaro as hostname.
And say you'll use kiliman as your "short" hostname.
Try this ... (it seems to work with 10.20)

1) Edit /etc/rc.config.d/netconf and put ..
NODENAME="kiliman"
2) Edit /etc/hosts
kilimanjaro kiliman
3) If DNS is enable, you might want to change /etc/nsswitch.conf to use /etc/hosts before resolving the hostname with DNS.
4) Edit /var/adm/inetd.sec and use IP addr of kilimanjaro instead of hostname.
Sachin Patel
Honored Contributor

Re: How to support more than 8 characters for hostname in HP-UX 11.0

Hi Yang,
It will work and not. If you have long name you are going to face lots of trouble.

Sachin
Is photography a hobby or another way to spend $
Bill Hassell
Honored Contributor

Re: How to support more than 8 characters for hostname in HP-UX 11.0

There are two names for HP-UX computers: uname and hostname. Normally they are the same and used interchangeably. You can set a long hostname in /etc/rc.config.d/netconf where it says HOSTNAME and then create a shortname for uname with the variable: NODENAME, for example:

HOSTNAME=mylongcomputername
NODENAME=myname

(this is loosely documented in /sbin/init.d/hostname)

Be sure to use the alias feature in /etc/hosts as previously mentioned, and also update your DNS server (if you use one) with the short and long names. As mentioned, using a long hostname can create occasional problems in some programs that assume 8 character maximum names.


Bill Hassell, sysadmin
jh_yang
Advisor

Re: How to support more than 8 characters for hostname in HP-UX 11.0

Thanks for all the replies.
It's said in HP-UX 11i Version 1.5 Reference Volume 1 that there is a file under . The hostname is restricted to MAXHOSTNAMELEN characters. If I could change this file to support longer hostname? If yes, how to apply it and will it cause further problems. Such change would leave hostname and uname different. Will this cause problems?
I am sure this only affects the hostname, not the uname. But there is another file name uname.h and has similar configurable parameters. If I change both of them and apply it(just rebuild the kernel?), will it work well?
Patrick Wallek
Honored Contributor

Re: How to support more than 8 characters for hostname in HP-UX 11.0

I don't think I recommend messing around with the param.h and uname.h files.

There is no telling what the consequences of that could be.
Sridhar Bhaskarla
Honored Contributor

Re: How to support more than 8 characters for hostname in HP-UX 11.0

Nodename is limited to 8 chars. When setuname is called, it looks for UTSLEN in the utsname structure as defined in utsname.h and sets up the nodename to a length of UTSLEN - 1.

Now can we modify UTSLEN to more than 9?... I don't try and I advise others not to try as we don't know the consequences.

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

Re: How to support more than 8 characters for hostname in HP-UX 11.0

uname is the UUCP name, and the utsname.h structure is an industry standard. Changing it may or may not affect your system...I wouldn't.

But as mentioned, the hostname, which is associated with the IP address, is not constrained to 8 characters. For compatibility, place at least 2 entries in /etc/hosts: uname (8 chars max) and hostname (long) plus additional aliases such as a Fully Quylaified Domain Name (FQDN).


Bill Hassell, sysadmin
Sanjay_6
Honored Contributor

Re: How to support more than 8 characters for hostname in HP-UX 11.0