linux:bind_install
文書の過去の版を表示しています。
目次
DNSサーバの構築
最近のトレンドは権威サーバとキャッシュサーバの分離。KVMで2台DNSサーバ立てることにするとそれぞれ単体で設定すればよいので、その方が単純かつセキュア。(まあ、単純なものほどセキュアなものだが)
BINDのインストール
インストールはapt
一発。(Ubuntu Serverの場合)
$ sudo apt install bind9
設定ファイル等は/etc/bind
以下に収められている。(Ubuntu 22.04.1 LTSで確認)
Setting-up BIND
そんなもん(8.8.8.8)に飛ばしてしまえ!っつうのは無しにして。
基本的には/etc/bind/named.conf
を変更するのだけれど、bind9.18.1のデフォルトでは
- /etc/bind/named.conf
include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; include "/etc/bind/named.conf.default-zones";
のようになっているので、
まずは、/etc/bind/named.conf.options
に必要な設定をする。
- /etc/bind/named.conf.options.org
acl local-network { 192.168.10.0/24; }; options { directory "/var/cache/bind"; allow-query { localhost; local-network; }; allow-recursion { localhost; local-network; }; allow-query-cache { localhost; local-network; }; forwarders { XXX.XXX.XXX.XXX; }; dnssec-validation auto; };
forwardersのXXX.XXX.XXX.XXX
には学科のDNSサーバを設定する。(将来的に学科のサーバを廃止するときにはどうするんかな)
- /etc/bind/named.conf.options
options { directory "/var/cache/bind"; allow-query { localhost; 192.168.10.0/24; }; forwarders { 150.55.XXX.XXX; // ここは管理者(俺だよ!俺)に問い合わせること }; dnssec-validation auto; };
<設定ファイルのチェックをした後、bindを起動する。
$ named-checkconf $ systemctl start named $ systemctl status named $ netstat -aun | grep 53 ... $ dig @localhost www.ee.ous.ac.jp ...
Setting-up BIND as Content Server
Content Serverと書いて権威サーバと読む。
BIND = NSD + Unbound
最近だとこんなのがいいらしい。
- dnsdist
- DNSリクエストをバックエンドDNSサーバにフォワード
- QNAME/リクエスト元IPアドレス/QTYPE等毎にバックエンドDNSサーバを指定
- NSD
- Unbound
BINDのインストール
kimi@sstw:~$ qemu-img create -f qcow2 images/content-server.qcow2 80G Formatting 'images/content-server.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=85899345920 lazy_refcounts=off refcount_bits=16 virt-install \ --name=sstx \ --disk=images/content-server.qcow2,bus=virtio \ --vcpus=2 --ram=2048 \ --graphics vnc,password=*********,listen=0.0.0.0,keymap=ja \ --cdrom iso/ubuntu-22.04-live-server-amd64.iso kimi@sstw:~$ virt-install --name=sstx --disk=images/content-server.qcow2,bus=virtio --vcpus=2 --ram=2048 --graphics vnc,password=********,listen=0.0.0.0,keymap=ja --cdrom iso/ubuntu-22.04-live-server-amd64.iso WARNING Graphics requested but DISPLAY is not set. Not running virt-viewer. WARNING No console to launch for the guest, defaulting to --wait -1 Starting install... Creating domain... | 0 B 00:00 Domain is still running. Installation may be in progress. Waiting for the installation to complete. Domain has shutdown. Continuing. Domain creation completed. Restarting guest. kimi@sstw:~$ kimi@sstb:~$ sudo apt update Hit:1 http://jp.archive.ubuntu.com/ubuntu jammy InRelease Hit:2 http://jp.archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:3 http://jp.archive.ubuntu.com/ubuntu jammy-backports InRelease Hit:4 http://jp.archive.ubuntu.com/ubuntu jammy-security InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. kimi@sstb:~$ sudo apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. kimi@sstb:~$ kimi@sstb:~$ sudo apt install bind9 /etc/bind/named.conf // This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; include "/etc/bind/named.conf.default-zones"; vi named.conf cp: cannot create regular file './db.10.168.192.in-addr.arpa': Permission denied cp: cannot create regular file './db.29.55.150.in-addr.arpa': Permission denied cp: cannot create regular file './db.31.55.150.in-addr.arpa': Permission denied cp: cannot create regular file './db.ee.ous.ac.jp': Permission denied kimi@sstb:/etc/bind$ systemctl restart named ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to restart 'named.service'. Authenticating as: Kiminori Kakitani (kimi) Password: ==== AUTHENTICATION COMPLETE === kimi@sstb:/etc/bind$
linux/bind_install.1660798791.txt.gz · 最終更新: 2022/08/23 13:34 (外部編集)