1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

年末はおうちでゆっくり WAF を楽しもうAdvent Calendar 2022

Day 9

Ubuntu 22.04 - hostname/domainname設定

Last updated at Posted at 2022-12-09

前提

連日 DNS に悩まされて辛かったので、今日は簡単な内容にする。簡単だけど、どこかで設定しないといけない内容だったので万事OK!

hostname 設定

恒久的に名前を変更する方法。

$ sudo hostnamectl set-hostname dns

確認

$ hostname -b
dns

domainname 設定

ドメイン名を設定。

$ sudo vi /etc/hosts

127.0.0.1 localhost
127.0.1.1 dns.j-fortidemo.com dns

確認

$ hostname -d
j-fortidemo.com

FQDN 確認

$ hostname -f
dns.j-fortidemo.com
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?