My original query:
> What is the practical limit on the size of a host name? Is something
> going to break if it is longer than 8 characters? 16 characters? I looked
> through the manual and couldn't find anything other than an example with
> 9 characters (but it is easy to fail to look in the right place in the manual).
> Grepping around in /usr/include produced the following results:
>
> nfs/nfs_clnt.h:#define HOSTNAMESZ 32
> sys/param.h:#define MAXHOSTNAMELEN 64
> protocols/rwhod.h: char wd_hostname[32]; /* hosts's name */
>
> which seems to suggest that the answer is 32. But if there is some piece
> of network software that only supports hostnames of 16 characters (or less)
> that may be the limiting factor.
I suspect that there is no "right" answer to this question. Here is a quick
summary of the responses I received:
> RFC 1035, which defines the implementation of the Domain Name Service,
> limits the length of a host name to 63 characters. (cf para 2.3.1)
> At one time, uucp had problems with host names longer than 6 characters.
> I do not know if this is still true.
> Host name need to be 8 character or less because hostname command only return
> the first 8 charcacter of your host name if it is more than 8 character and
> on some other system for example on VAX/VMS the host name must be 8 or less for
> DecNet host name.
(In the BSD source code for "hostname" that I was able to find, the limit for
"hostname" was 31 characters (plus one for the NULL that terminates the
string). Of course, that doesn't stop some other implementation from doing
it differently.)
> Well, none of the NIS maps break for 9 chars, but occasionally I run into a
> minor glitch. Last week, I had trouble making a setup file for telnet for
> MS-Windows on a PC with PC-NFS5.0. It wanted to make the setup file the
> hostname.set, which doesn't work on a PC when the hostname is > 8 chars.
>
> Somewhere though, I thought I seen a similiar discussion when the hsot
> name was greater than 12 or 16 chars on of the NIS maps wouldn't push right
> or something.
>
> Oh, BTW, each entry in /etc/netgroup (ie each group def) is limited to about
> 256 chars. Anything after that is left out after the make. If you have alot
> of 20 chars hostnames, you may have to break up the netgroups, and nest them.
> If you have to talk to PC's via PC-NFS on your net, they cannot have
> hostnames greater than 16 chars.
> Sun only uses the first 9 characters of a hostname when generating license
> codes for their "lmgrd" license software.
> somewhere there is an official standard that says that 8 is the maximum
> "standard" length that has to be supported by everybody.
> I don't know that it's a *hard* limit, but there are at least convenience
> reasons to stay under 16 for the hostname (which often means the
> fully-qualified name). Among other things, the utmp file only records 16
> chars. This means that figuring out where (e.g, what host) a person is
> logging in from is easier if what, say, "finger," reports is complete. This,
> in turn, implies a shorter limit to the host portion of the F-Q name,
> depending on the length of the domain part.
> I can't say for sure on the sun side. However, on our network we are not
> limited by the Sun, but by our network nameserver. Its limit is 10 characters
> per hostname.
> HOWEVER, remember that YOU (and your users) will be typing in the hostname,
> over and over and over... Having to mail to
> username@superintendent-in-charge-of-long-names-build-by-weird-sysadmins.mcs.dr
> is bound to piss someone off.
> We have encountered some software that breaks if the hostname (FQDN even!)
> is > 16 characters. The vendors concede it is 'broken', but that doesn't
> actually help us run the software while waiting for them to fix it &
> release a new version. (PC software, by the way. We work around by having
> a shorter CNAME in the DNS for the hosts we need to access.)
We let the machine user pick the host name (at least mostly). That is why
this question arose. We have now set up a new machine with a 12 character host
name and a 6 character "nickname" alias. So far it all is working fine.
Thanks to:
David Fetrow <fetrow@biostat.washington.edu>
Amir Ilbeig <ilbeig@math.UH.EDU>
Joseph P DeCello III <jpd@discovery.cl.msu.edu>
bchivers@smiley.mitre.org (Brent Chivers)
pallas@oclc.org (George Pallas)
szh@zcon.com (Syed Zaeem Hosain)
lem@shaddam.usb.ve (LDC - Luis E. Mun~oz)
cogan@mso.anu.edu.au (Bruce Cogan)
hkatz@nucmed.NYU.EDU (Henry Katz)
bartz@dadd.ti.com (Carl Bartz)
adam%bwnmr4@harvard.harvard.edu (Adam Shostack)
danny@ews7.dseg.ti.com (Danny Johnson)
Ray Schnitzler <ras@unipress.com>
djh@hobbes.rational.com (Doris Harrington)
mharris@jpmorgan.com (Michael Harris)
oliver@ast.saic.com (Thomas W Oliver)
perryh@pluto.rain.com (Perry Hutchison)
Clive Newall <clive@asis.unimelb.EDU.AU>
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:59 CDT