0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

dnsmasq - Quick Start

Posted at

概要

(自分メモ) アドレス解決を伴うアプリの検証用にできるだけ簡単にDNSを建てたい。

環境

  • Ubuntu 24.04
  • dnsmasq 2.90

導入

sudo apt install -y dnsmasq

# 確認
sudo systemctl list-unit-files -t service| grep dnsmasq
# dnsmasq.service                              enabled         enabled
# dnsmasq@.service                             disabled        enabled

設定

/etc/dnsmasq.conf
no-resolv
no-poll
server=10.144.***.***  # 上流DNSサーバ
bind-interfaces
listen-address=127.0.0.1
listen-address=::1
listen-address=192.168.***.*** # 外部ホストからアクセス可

# 正引き設定
# address=/<FQDN>/<IP-Address>
address=/jimuki-1/10.36.xxx.xxx
address=/jimuki-2/10.36.yyy.yyy

# 逆引き設定
# ptr-record=<IP-Address(逆バイトオーダ)>.in-addr.arpa.,"<FQDN>"
ptr-record=xxx.xxx.36.10.in-addr.arpa.,"jimuki-1"
ptr-record=yyy.yyy.36.10.in-addr.arpa.,"jimuki-2"

no-dhcp-interface=
/etc/systemd/resolved.conf - このOS上のDNSリソルバを今立てたDNSにむける場合
[Resolve]
DNS=127.0.0.1
# ...
サービス再起動
sudo systemctl restart dnsmasq systemd-resolved

# テスト
nslookup 10.36.xxx.xxx -- 192.168.***.***
nslookup jimuki-1 -- 192.168.***.***
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?