Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ホスト名の命名規則について調査してみた
Search
YouYou
May 29, 2021
Programming
0
10k
ホスト名の命名規則について調査してみた
詳細ブログ↓
https://zenn.dev/yuta28/articles/hostname-os-research
YouYou
May 29, 2021
Tweet
Share
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
200
今インフラ技術をイチから学び直すなら
yuhta28
1
230
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
610
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.6k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.5k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.2k
Datadogのコストも監視しよう
yuhta28
1
940
Rcloneを使った定期的なストレージ同期
yuhta28
0
700
Pulumiを触ってみよう
yuhta28
1
2.4k
Other Decks in Programming
See All in Programming
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
120
Hack Claude Code with Claude Code
choplin
3
960
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
12
3.1k
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
350
Team operations that are not burdened by SRE
kazatohiei
1
310
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
77
25k
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
2k
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
760
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
280
ふつうの技術スタックでアート作品を作ってみる
akira888
1
490
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
270
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
6
2.5k
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Site-Speed That Sticks
csswizardry
10
680
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
280
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
RailsConf 2023
tenderlove
30
1.1k
Scaling GitHub
holman
459
140k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Transcript
ホスト名の命名規則について 調査してみた
Name:ユータ Occupation:SRE Twitter:@Y0u281 (オーでなくゼロです) ブログ:https://zenn.dev/yuta28 自己紹介 Twitter 2
目次 • きっかけ • 疑問 • 検証 • 調査結果 •
おまけ • まとめ
きっかけ • CentOSからUbuntuへのサーバー移行 • 移行後にホスト名をCentOSのものに変更したら失敗した アンダースコアが消えてる
きっかけ • ホスト名を変更したが、正しく変更されなかった。 • 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 (.). ホスト名は24文字以下で英字、数字、ハイフン(-)、ピリオド(.)が使用できます。ピリオドは、 ドメイン名の区切りに限ってのみ使用できます。
疑問 • RFCのルールは厳密に守られているのか • OS毎にルールの遵守が異なるのか CentOSでアンダースコアをホスト名に 使えるのはなぜ?
検証 1. ホスト名にアンスコ(_)、アットマーク(@)、アスタリスク(*)を使えるか 2. ホスト名に日本語は使えるか 3. ホスト名の先頭に英字以外の文字が使えるか 4. ホスト名の最後にハイフン (-)、ピリオド(.)が使えるか
5. ホスト名の文字数に24文字以上設定できるか 6. 空白文字が使えるか • Ubuntu 20.04 • Amazon Linux 2 • Red Hat Enterprise Linux 8.3 • openSUSE 15.2 • Debian GNU/Linux 10
・Ubuntu ・Amazon Linux2 UbuntuとAmazon Linux2の比較 $ sudo hostnamectl set-hostname Yuta_Ubuntu@PC*AWS
#ルール①検証 $ hostname YutaUbuntuPCAWS $ sudo hostnamectl set-hostname Yuta_Amazon@Linux2*AWS #ルール①検証 $ hostname yuta_amazonlinux2aws $ sudo hostnamectl set-hostname Yuta- #ルール④検証 $ hostname Yuta $ sudo hostnamectl set-hostname Yuta- #ルール④検証 $ hostname yuta-
調査結果 検証 Ubuntu Amazon Linux2 RHEL openSUSE Debian ① ☓
△ △ △ ☓ ② ☓ ☓ ☓ ☓ ☓ ③ ◦ ◦ ◦ ◦ ◦ ④ ☓ △ △ △ ☓ ⑤ ◦ ◦ ◦ ◦ ◦ ⑥ ☓ ☓ ☓ ☓ ☓
おまけ はどうなの?
検証 1. ホスト名にアンスコ(_)、アットマーク(@)、アスタリスク(*)を使えるか 2. ホスト名に日本語は使えるか 3. ホスト名の先頭に英字以外の文字が使えるか 4. ホスト名の最後にハイフン (-)、ピリオド(.)が使えるか
5. ホスト名の文字数に24文字以上設定できるか 6. 空白文字が使えるか Windowsだしルール遵守で 全部使えないだろうなー
おまけ Windows Server 2019は日本語ホストネームが使えた!
まとめ • Ubuntu系はルール遵守が厳しい • Fedora系は寛容 • Windowsは独自性
ありがとうございました より詳しい内容は以下のブログで↓ Linuxのホスト名について調査して みた 14