1820477 Members
3018 Online
109624 Solutions
New Discussion юеВ

Valid hostnames

 
SOLVED
Go to solution
H_16
Trusted Contributor

Valid hostnames

Can I use hyphen in a hostname on a HPUX 11.23 PA-RISC

US-APP-LIVE01
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: Valid hostnames

Do a man on uname and on hostname.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Valid hostnames

After that somewhat cursory answer, I did a little reading myself and I can't find any specific exclusion of hyphens in a name. The length , however, seems to be 8 characters as a general rule. I believe this can be altered/extended but it is not usually recommended.

My own recommendation would be to stick with an 8 character, hyphen-less name.


Pete

Pete
Dennis Handly
Acclaimed Contributor

Re: Valid hostnames

I have a whole family of machines with "-". The only problem was a perl script that wasn't expecting that char.
VK2COT
Honored Contributor

Re: Valid hostnames

Hello,

Hyphen is perfectly valid character in hostnames.

Use upper and lower case alphabet,
numerals, hyphen and dot.

Yes, eight characters in hostnames
is the limitation in most Unices.
It can be extended in HP-UX 11.31
through dynamic kernel parameter
expanded_node_host_names but you need
to ensure that your applications can
support it!

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Bob E Campbell
Honored Contributor
Solution

Re: Valid hostnames

To be clear...

hostname can be set to more than 8 chars, uname cannot. It is strongly *recommended* that uname and hostname return the same value.

That said, you can have plenty of aliases set to the same IP address.
VK2COT
Honored Contributor

Re: Valid hostnames

Hello,

Yes, Bob is right.

I actually check for presence of hostname and uname settings in config file.

Here is part of my own HP-UX audits:

CHECKING NODENAME LENGTH
________________________
AUDIT-PASS: Nodename length (5 for ia644) satisfies recommended limit of 8 characters
AUDIT-INFO: Dynamic kernel parameter expanded_node_host_names is available

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

AUDIT-INFO: Hostname ia644 contains alphabetic characters only

AUDIT-INFO: Variable "HOSTNAME" in /etc/rc.config.d/netconf set to "ia644"

AUDIT-INFO: Variable "NODENAME" not set in /etc/rc.config.d/netconf

Perl script is here:

http://www.circlingcycle.com.au/Unix-sources/HP-UX-check-OAT.pl.txt

Cheers,

VK2COT
VK2COT - Dusan Baljevic