1837507 Members
3728 Online
110117 Solutions
New Discussion

hostname length

 
SOLVED
Go to solution
Mauro Gatti
Valued Contributor

hostname length

Hi all, could You explain to me if there is any limit to hostname lenght?
Which problem types can I find using a long hostname?


Thank You
Ubi maior, minor cessat!
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: hostname length

Hi,

The max lenght of the hostname should be 8 characters.

Robert-Jan
Michael Tully
Honored Contributor

Re: hostname length

8 characters is the standard maximum length. You will find problems attempting to make it longer.
Anyone for a Mutiny ?
Stefan Farrelly
Honored Contributor
Solution

Re: hostname length

The limit is 64 characters, although you can use a hostname up to 255 characters anything greater >64 characters may cause problems so its advisable to stick to <=64.

Check out this detailed question and answers;

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=301546
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ravi_8
Honored Contributor

Re: hostname length

Hi,

8 characters is the maxumum standard length, you can also set the name longer the 8 characters, but it gives problem while executing problems like, swlist etc.

In such case set the hostname from command line

#hostname
never give up
Fabio Ettore
Honored Contributor

Re: hostname length

Ciao Mauro,

you could have problems with long hostname; they are about resolution names, using uname or something else. Just another example: I know a lot of cases about problem of systems with long hostname working on Omniback (now Data Protector).

From the hostname(1) man page:

The name_of_host argument is restricted to
MAXHOSTNAMELEN characters as defined in .

Running grep MAXHOSTNAMELEN /usr/include/sys/param.h shows:

#define MAXHOSTNAMELEN 64 /* max length of hostname */

So, the hostname can be 64 characters but the uname nodename can only be 8.

I hope this helps you.

Best regards,
Ettore
WISH? IMPROVEMENT!
Jakes Louw
Trusted Contributor

Re: hostname length

Ettore is on the button: while you can set hostname to more than 8 chars, other routines have a fit or just truncate this down to 8 anyway.

This would be, among others, DNS, NIS/YP, and so on.
Some of the sub-routines like gethostent and so on do not check the name length, but assume 8 chars, I suppose.

Funny how UNIX works, eh?
Trying is the first step to failure - Homer Simpson
Jdamian
Respected Contributor

Re: hostname length

Did anybody in HP Labs think to plant the increasing of nodename length ?

The nodename is set for UUCP connections but... who uses UUCP connections today ?
Have you ever used a similar command to this:

uucp myfile.txt sys2!sys3!sys4!/home/joe

?
Rory R Hammond
Trusted Contributor

Re: hostname length


I use uucp.

1. Unlike ftp UUCP does handle failed transfers and retries.
2. UUCP notifies the sysadmin when transfers fails

3. UUCP works for dailup and tcp transfers

4. You can restrict commands and directory locations for transfers. (Permissions)

5. UUCP provideds sane notification of arriving data files.
6. You can use scripting with UUCP


Rory
There are a 100 ways to do things and 97 of them are right
Bill Hassell
Honored Contributor

Re: hostname length

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.


Bill Hassell, sysadmin