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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
YouYou
May 29, 2021
Programming
0
11k
ホスト名の命名規則について調査してみた
詳細ブログ↓
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
270
今インフラ技術をイチから学び直すなら
yuhta28
1
270
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
3
650
Datadog外形監視基盤をEC2から ECSへ移行してみた
yuhta28
0
1.7k
アウトプット頑張ったら企業からLT登壇の依頼がきた話
yuhta28
1
1.8k
小さなことから始めるAWSコスト最適入門
yuhta28
1
1.3k
Datadogのコストも監視しよう
yuhta28
1
1k
Rcloneを使った定期的なストレージ同期
yuhta28
0
810
Pulumiを触ってみよう
yuhta28
1
2.7k
Other Decks in Programming
See All in Programming
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
130
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
0
130
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
760
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
130
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
480
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
290
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
400
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
790
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
230
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
320
Git: the NoSQL Database
bkeepers
PRO
432
66k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.4k
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