karubabuの日記

タイトルに解決と書いているものがあるけれど、別に付いていない物は解決していないというわけではないです。つまるところ記事を書いた後に解決してちょっと嬉しかったので付けました。

net-dns/https_dns_proxyのserviceファイルを書いた

[Unit]
Description=A lightweight DNS-over-HTTPS proxy. 
Documentation=https://github.com/aarond10/https_dns_proxy
After=network.target
Before=nss-lookup.target
Wants=nss-lookup.target

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/usr/bin/https_dns_proxy -d -b 1.1.1.1,1.0.0.1 -r "https://1.1.1.1/dns-query?ct=application/dns-json&" -p 5353
LimitNOFILE=1048576
Restart=always
RestartSec=3
Type=forking
User=nobody
Group=nobody

[Install]
WantedBy=multi-user.target

/etc/systemd/system/あたりに置いて起動してね
待ち受けるポートが5353になっているのでdnsmasqとかを使わない人は53に戻さないのウンともスンとも言わないと思う
dnsmasqとの併用は前に書いた記事を参照してね
DNS over https + dnsmasqする - karubabuの日記

大体はここから拝借しています…
GitHub - m13253/dns-over-https: Client and server software to query DNS over HTTPS
AmbientCapabilitiesめちゃ便利ですごい