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
11k
0
Share
ホスト名の命名規則について調査してみた
詳細ブログ↓
https://zenn.dev/yuta28/articles/hostname-os-research
YouYou
May 29, 2021
More Decks by YouYou
See All by YouYou
AWSマネコンに複数のアカウントで入れるようになりました
yuhta28
2
280
今インフラ技術をイチから学び直すなら
yuhta28
1
280
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
660
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.8k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.8k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.4k
Datadogのコストも監視しよう
yuhta28
1
1.1k
Rcloneを使った定期的なストレージ同期
yuhta28
0
820
Pulumiを触ってみよう
yuhta28
1
2.7k
Other Decks in Programming
See All in Programming
AIエージェントで業務改善してみた
taku271
0
550
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
280
How Swift's Type System Guides AI Agents
koher
0
310
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
870
Programming with a DJ Controller — not vibe coding
m_seki
3
620
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
170
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
190
Explore CoroutineScope
tomoeng11
0
120
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
120
Swift Concurrency Type System
inamiy
1
560
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
500
🦞OpenClaw works with AWS
licux
1
300
Featured
See All Featured
Discover your Explorer Soul
emna__ayadi
2
1.1k
Abbi's Birthday
coloredviolet
2
7.3k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Building the Perfect Custom Keyboard
takai
2
740
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
490
How to Talk to Developers About Accessibility
jct
2
190
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
How to make the Groovebox
asonas
2
2.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
780
Embracing the Ebb and Flow
colly
88
5k
Speed Design
sergeychernyshev
33
1.6k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
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