技術メモ

神奈川在住のITエンジニアの備忘録。おもにプログラミングやネットワーク技術について、学んだことを自分の中で整理するためにゆるゆると書いています。ちゃんと検証できていない部分もあるのでご参考程度となりますが、誰かのお役に立てれば幸いです。

ホスト名にアンダースコア (_) は許容されていない。

rfcを読むと、ホスト名に許容されている文字にアンダースコア(_)は含まれていない。

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 952 - DoD Internet host table specification

 

ITの世界では、名前中の区切り文字としてアンダースコアを入れることがあるが、ホスト名には入れてはいけないので、要注意である。あと、ホスト名の大文字・小文字は区別されない。