環境
- Wireguard
- Ubuntu 20.04
概要
ArchLinuxのWikiに詳しく載ってるのでUbuntuでも使えるように改修した
コマンド
# cat /etc/systemd/system/wireguard_reresolve-dns.service [Unit] Description=Reresolve DNS of all WireGuard endpoints Wants=network-online.target After=network-online.target [Service] Type=oneshot ExecStart=/bin/sh -c '/usr/local/bin/reresolve-dns.sh wg0' [Install] WantedBy=multi-user.target
# cat /etc/systemd/system/wireguard_reresolve-dns.timer [Unit] Description=Periodically reresolve DNS of all WireGuard endpoints [Timer] OnUnitActiveSec=10s Unit=wireguard_reresolve-dns.service [Install] WantedBy=timers.target
systemctl start wireguard_reresolve-dns.timer systemctl enable wireguard_reresolve-dns.timer