1820390 Members
3454 Online
109623 Solutions
New Discussion юеВ

host name requirementts

 
Hanry Zhou
Super Advisor

host name requirementts

I have an itanium server and going to be running 11i v2. What is the requirements on the server name? for instance, the length of the name?

If I name 12 long: xxxxxx-Y-ZZ1
would that be any problems?

Thanks,
none
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: host name requirementts

Shalom,

Standard is still 8 character for hostname.

There is an add in to permit longer hostnames on http://software.hp.com

I would not use it, but you can.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hanry Zhou
Super Advisor

Re: host name requirementts

what about if I use two "-" in the name? as the format of "xxxxxx-Y-ZZ1"?
none
Bill Hassell
Honored Contributor

Re: host name requirementts

From the hostname man page:

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

See also: man 5 hostname

Since your hostname may have to work with dozens of other OS's and versions, use alphanumerics only. Special characters will get you in trouble, if not now, eventually...

Also, don't confuse the hostname and nodename. The basic nodename of a system is the 8 character name defined in the hostname(1) man page. The hostname (defined in /etc/rc.config.d/hostname) can be longer but it is recommended that the simple name be defined first, followed by longer names (as aliases) including fully qualified domain names (ie, FQDN such as myname.mydomain.com). You can have dozens of different names for the same server...

Because hostnames are shared among other network devices, eventually a hostname such as abc-12_34%ta will cause a lot of sysaadmin headaches. Take a hint from human engineering studies and use meaningful names like yoda and daffy. The data center manager will go crazy because she wants the names to match the floor tile grid and the network guys want the names to correspond to the network identifiers and the application people want the names to look like...

All the while forgetting that machines will move and people just don't relate well to gobbledygook names (that's a technical term).


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: host name requirementts

>what about if I use two "-" in the name?

I have a bunch of machines with "-" and 8 char names. About the only recent problem was a perl script that didn't expect that "-".
Bill Thorsteinson
Honored Contributor

Re: host name requirementts

There is an RFC (RFC 952) which covers the rules host names. The perl script was incorrect. Hyphens are not allowed. Names begin with an alphabetic character and contain only alphanumerics and hyphens. Good practic is to make your hostname unique in the first eight characters SMTP servers frequently enforce this if verifying the incoming connect.

I use primary hostname that are always strictly alphabetic. Check RFC 1178 for help in choosing hostnames.
Bill Thorsteinson
Honored Contributor

Re: host name requirementts

There is an RFC (RFC 952) which covers the rules host names. The perl script was incorrect. Hyphens are not allowed. Names begin with an alphabetic character and contain only alphanumerics and hyphens. SMTP servers frequently enforce this if verifying the incoming connection.

Good practice is to make your hostname unique in the first eight characters. On servers, I use primary hostnames that are always strictly alphabetic. Check RFC 1178 for help in choosing hostnames.
rick jones
Honored Contributor

Re: host name requirementts

Iwas always under the impression that it was underscore and not hyphen which was disallowed.
there is no rest for the wicked yet the virtuous have no pillows
VK2COT
Honored Contributor

Re: host name requirementts

Hello,

This is an interesting issue.
Here is why:

Underscores are not valid characters in hostnames (forget about WINS
database in Windows :)).

Hence, advsg_200 and others should avoid having "_" character in their names.

Here is why:

RFC 952 (DOD Internet Host Table Specification) defines host names as folows:

1. A "name" (Net, Host, Gateway, or Domain name) is a text string up
to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus
sign (-), and period (.). Note that periods are only allowed when
they serve to delimit components of "domain style names". (See
RFC-921, "Domain Name System Implementation Schedule", for
background). No blank or space characters are permitted as part of a
name. No distinction is made between upper and lower case. The first
character must be an alpha character. The last character must not be
a minus sign or period.

RFC 1123 (Requirements for Internet Hosts -- Application and Support) modifies
952 as follows:

2.1 Host Names and Numbers

The syntax of a legal Internet host name was specified in RFC-952
[DNS:4]. One aspect of host name syntax is hereby changed: the
restriction on the first character is relaxed to allow either a
letter or a digit. Host software MUST support this more liberal
syntax.

Note that under 952, A123.org is valid, but 123.org is not. Under 1123,
the requirement that the first character be alphabetic is lifted, so 123.org
is now valid.

RFC 1035 says:

2.3.1. Preferred name syntax

The DNS specifications attempt to be as general as possible in the rules
for constructing domain names. The idea is that the name of any
existing object can be expressed as a domain name with minimal changes.

However, when assigning a domain name for an object, the prudent user
will select a name which satisfies both the rules of the domain system
and any existing rules for the object, whether these rules are published
or implied by existing programs.

For example, when naming a mail domain, the user should satisfy both the
rules of this memo and those in RFC-822. When creating a new host name,
the old rules for HOSTS.TXT should be followed. This avoids problems
when old software is converted to use domain names.

And so on.

In Unix, hostnames are designed with limit of up to eight characters.
Longer hostnames are simply truncated and various applications might
experience a problem.

HP-UX 11.31 has support for longer hostnames but many other third-party applications might not support it.

Hence, hyphen IS VALID character.
Underscore is NOT VALID character.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
VK2COT
Honored Contributor

Re: host name requirementts

By the way,

In my Perl Operations Acceptance Testing
script I check it for Unix servers (here
is a small extract for an HP-UX 11.31 server):

CHECKING NODENAME LENGTH
________________________
PASS Nodename length (5 for syd59)
INFO Dynamic kernel parameter expanded_node_host_names is available

CHECKING HOSTNAME CONTAINS VALID CHARACTERS
___________________________________________
PASS Valid characters in hostname syd59
RFCs define valid characters as 'a-zA-Z0-9.-'

http://www.circlingcycle.com.au/Unix-sources/

Cheers,

VK2COT
VK2COT - Dusan Baljevic