ホスト名には使用してはいけない文字がある

物忘れが激しい自分の為に記録(;^ω^)

家ではraspberry piが3台稼働していまして2台はカメラとして使用してるんですよね。

でセットアップした時に適当な名前を付けちゃったので2台のraspberry piにそれぞれ

camera_1

camera_2

って名前を付け直したんですが。。。。。

hostoname コマンドを叩くと。

$ hostname
(none)
 
$ uname -n
(none)

なんてなっちゃう。

なんでnone ?

定番の下記、二つのファイルもちゃんと書き換えてるのに・・・・

/etc/hostname

/etc/hosts

わけわからないので必死で /etc/init.d/hostname.sh の中身をワンステップ実行したりして動作させてもわからない。

で、とーおいとーい昔の記憶 で閃いてしまいました。

そう!! たしかホスト名に使えない文字があったのを。

ちょっとググればなんぼでも出てくるやん。

FAQ中のFAQやんか(^^♪

Avoid using the underscore (_) character in machine names. Internet standards dictate that domain names conform to the host name requirements described in Internet Official Protocol Standards RFC 952 and RFC 1123. Domain names must contain only letters (upper or lower case) and digits. Domain names can also contain dash characters ( – ) as long as the dashes are not on the ends of the name. Underscore characters ( _ ) are not supported in the host name

IBM Knowledge Center に記載。

と言うわけでホスト名は、

camera-1

camera-2

として解決(^^♪

RPi3 本体+ケース+ヒートシンク セット Raspberry Pi 3 Model B+ヒートシンク銅の一つアルミの一つ+クリアケース 3in1キット (透明ケース)

Wi-Fi/Bluetooth/ZigBee無線用Raspberry Piプログラム全集 (マイコン活用シリーズ)

シェアする

  • このエントリーをはてなブックマークに追加

フォローする