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?

More than 5 years have passed since last update.

archでdns-over-httpsを設定してみたお話

Last updated at Posted at 2020-02-12

archでdns-over-httpsを設定してみたお話

普段dnsmasqは動かしてるので
そろそろ使ってみようと思ってとりあえずやってみた

必要なパッケージをインストール

今回はdns-over-httpsを使用

$ sudo pacman -S dns-over-https
resolving dependencies...
looking for conflicting packages...

Packages (1) dns-over-https-2.2.1-1
...

以下設定とか

設定としてはとりあえず最小限の変更として、listenだけ調整してやりました

何も使ってない環境は調整不要のはずなのでお好みで

$ /etc/dns-over-https/doh-client.conf
# DNS listen port
listen = [
      #"127.0.0.1:53",
      "127.0.0.1:5380",

systemdへ普通にスタート登録して起動

systemctl enable doh-client
systemctl start doh-client

dnsmasqを使っているので、設定に次の項目を入れてやりました。

# no reading resolv.conf
no-resolv

# to local doh-client
server=127.0.0.1#5380

あとはdoh-clientを参照するように設定で完了

$ /etc/resolve.conf
nameserver 127.0.0.1

使用確認について

これで暗号化されてDNS参照ができるようになりました。

一応digってみてもなんの変化も有りませんが、少しはセキュアになってます。

$ dig @127.0.0.1 www.google.com

; <<>> DiG 9.14.7 <<>> @127.0.0.1 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53182
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
; PAD (65 bytes)
;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         140     IN      A       172.217.26.4

;; Query time: 10 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)

気になる場合は doh-client.conf に verbose=true を追加
journald等でログを眺めてやるとニヤニヤできます。

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?