今日の作業(インストール)

インストールしたのは ubuntu server 20.04.3 LTS
パッケージの更新
# apt update
# apt upgrade

https://www.server-world.info/query?os=Ubuntu_20.04&p=dnsmasq&f=1
↑ここを参考にしてDnsmasq のインストール
root@ubuntu-server:~# apt -y install dnsmasq
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
dns-root-data dnsmasq-base libidn11
Suggested packages:
resolvconf
The following NEW packages will be installed:
dns-root-data dnsmasq dnsmasq-base libidn11
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 383 kB of archives.
After this operation, 1,155 kB of additional disk space will be used.
Get:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 dns-root-data all 2019052802 [5,300 B]
Get:2 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libidn11 amd64 1.33-2.2ubuntu2 [46.2 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 dnsmasq-base amd64 2.80-1.1ubunt
u1.4 [315 kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu focal-updates/universe amd64 dnsmasq all 2.80-1.1ubuntu1.
4 [16.5 kB]
Fetched 383 kB in 0s (1,287 kB/s)
Selecting previously unselected package dns-root-data.
(Reading database … 71549 files and directories currently installed.)
Preparing to unpack …/dns-root-data_2019052802_all.deb …
Unpacking dns-root-data (2019052802) …
Selecting previously unselected package libidn11:amd64.
Preparing to unpack …/libidn11_1.33-2.2ubuntu2_amd64.deb …
Unpacking libidn11:amd64 (1.33-2.2ubuntu2) …
Selecting previously unselected package dnsmasq-base.
Preparing to unpack …/dnsmasq-base_2.80-1.1ubuntu1.4_amd64.deb …
Unpacking dnsmasq-base (2.80-1.1ubuntu1.4) …
Selecting previously unselected package dnsmasq.
Preparing to unpack …/dnsmasq_2.80-1.1ubuntu1.4_all.deb …
Unpacking dnsmasq (2.80-1.1ubuntu1.4) …
Setting up dns-root-data (2019052802) …
Setting up libidn11:amd64 (1.33-2.2ubuntu2) …
Setting up dnsmasq-base (2.80-1.1ubuntu1.4) …
Setting up dnsmasq (2.80-1.1ubuntu1.4) …
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/d
nsmasq.service.
Job for dnsmasq.service failed because the control process exited with error code.
See “systemctl status dnsmasq.service” and “journalctl -xe” for details.
invoke-rc.d: initscript dnsmasq, action “start” failed.
● dnsmasq.service – dnsmasq – A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-09-13 09:14:47 JST; 30ms ago
Process: 3007 ExecStartPre=/usr/sbin/dnsmasq –test (code=exited, status=0/SUCCESS)
Process: 3008 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)

Sep 13 09:14:47 ubuntu-server systemd[1]: Starting dnsmasq – A lightweight DHCP and caching DNS ser
ver…
Sep 13 09:14:47 ubuntu-server dnsmasq[3007]: dnsmasq: syntax check OK.
Sep 13 09:14:47 ubuntu-server dnsmasq[3008]: dnsmasq: failed to create listening socket for port 53
: Address already in use

Sep 13 09:14:47 ubuntu-server dnsmasq[3008]: failed to create listening socket for port 53: Address
already in use

Sep 13 09:14:47 ubuntu-server systemd[1]: dnsmasq.service: Control process exited, code=exited, sta
tus=2/INVALIDARGUMENT
Sep 13 09:14:47 ubuntu-server dnsmasq[3008]: FAILED to start up
Sep 13 09:14:47 ubuntu-server systemd[1]: dnsmasq.service: Failed with result ‘exit-code’.
Sep 13 09:14:47 ubuntu-server systemd[1]: Failed to start dnsmasq – A lightweight DHCP and caching
DNS server.

Processing triggers for libc-bin (2.31-0ubuntu9.2) …
Processing triggers for systemd (245.4-4ubuntu3.11) …
Processing triggers for man-db (2.9.1-1) …
Processing triggers for dbus (1.12.16-2ubuntu2.1) …
root@ubuntu-server:~#


着色部・・・何やらエラーが出ているようだ。port 53は使用中?
ここに同じような現象を解決したブログがあったので参考にする。

# netstat で状況確認しよう
Command ‘netstat’ not found, but can be installed with:
apt install net-tools

ツールをインストールせよ!と
# apt install net-tools
でインストールした。
# lsof -i:53 ←port 53を使っているのは?
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd-r 706 systemd-resolve 12u IPv4 27462 0t0 UDP localhost:domain
systemd-r 706 systemd-resolve 13u IPv4 27463 0t0 TCP localhost:domain (LISTEN)

どうやらsystemd-resolvedが使っているようだ。
ここを参考にして systemd-resolved を無効にしてみる。副作用は「systemd-resolvdを無効にすると、一部のユーザーのVPNで名前解決が機能しなくなる可能性があることに注意してください。」今回使わない予定なので良しとする。


今日の作業

今日の作業(概略手順)

Windows PCで作業する。
1.Ubuntu Server 20.04.3 LTSのISOファイルをダウンロードここから→
https://jp.ubuntu.com/download

2.Rufusソフトをダウンロードここから→https://rufus.ie/ja/
Rufusソフトを起動してUSBメモリにISOファイルを書き込む

ここからインストール先のPCで作業する。

3.USBメモリでUbuntu Serverをインストール

4.無事OSインストールを完了し、起動確認