-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup-wg.sh
More file actions
31 lines (26 loc) · 801 Bytes
/
Copy pathsetup-wg.sh
File metadata and controls
31 lines (26 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
cat <<EOF | sudo tee /etc/systemd/resolved.conf.d/pendrellvale.conf
[Resolve]
DNS=10.0.0.1
FallbackDNS=1.1.1.1
Domains=home ~.
ResolveUnicastSingleLabel=yes
EOF
cat <<EOF | sudo tee /usr/lib/systemd/system/wg-pre-dns-fix.service
[Unit]
Description=WireGuard Endpoint Pre-DNS Fix
After=network-online.target systemd-resolved.service
Before=wg-quick@wg0.service
[Service]
Type=oneshot
# This command routes the ONLY the mendess.xyz query to the public DNS on wlp0s20f3
ExecStart=/usr/bin/resolvectl domain wlp0s20f3 mendess.xyz
ExecStop=/usr/bin/resolvectl domain wlp0s20f3 -mendess.xyz
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
sudo sctl daemon-reload
sudo sctl enable wg-pre-dns-fix.service
sudo sctl start wg-pre-dns-fix.service
sudo sctl restart systemd-resolved