BIND : DNS over HTTPS サーバーの設定2023/04/24 |
BIND での DNS over HTTPS サーバーの設定です。
|
|
[1] |
事前に SSL/TLS 証明書を取得しておきます。
|
[2] | BIND の設定です。 |
root@dlp:~#
openssl dhparam -out /etc/bind/dhparam.pem 3072 root@dlp:~# cp /etc/letsencrypt/live/dlp.srv.world/{fullchain.pem,privkey.pem} /etc/bind/ root@dlp:~# chown bind:bind /etc/bind/{fullchain.pem,privkey.pem,dhparam.pem}
root@dlp:~#
vi /etc/bind/named.conf.options # 証明書の設定を追記 tls local-tls { key-file "/etc/bind/privkey.pem"; cert-file "/etc/bind/fullchain.pem"; dhparam-file "/etc/bind/dhparam.pem"; }; http local { endpoints { "/dns-query"; }; }; options { ..... ..... dnssec-validation auto; # 以下のように追記/変更 listen-on tls local-tls http local { any; }; listen-on-v6 tls local-tls http local { any; }; };root@dlp:~# systemctl restart named |
[3] | HTTPS で名前解決ができるかどうかの動作確認を行います。 |
root@dlp:~# dig +https @127.0.0.1 dlp.srv.world. ; <<>> DiG 9.18.12-1ubuntu1-Ubuntu <<>> +https @127.0.0.1 dlp.srv.world. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44727 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ; COOKIE: ced10b7bc114178c01000000644612b6b4eb254f4023d065 (good) ;; QUESTION SECTION: ;dlp.srv.world. IN A ;; ANSWER SECTION: dlp.srv.world. 86400 IN A 10.0.0.30 ;; Query time: 4 msec ;; SERVER: 127.0.0.1#443(127.0.0.1) (HTTPS) ;; WHEN: Mon Apr 24 05:25:10 UTC 2023 ;; MSG SIZE rcvd: 86 |
Sponsored Link |