minor fix and add automatic updates
[distro-setup] / untrusted-network
1 #!/bin/bash
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5
6 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
7
8 # Usage: use when switching from a trusted network to an untrusted one,
9 # like public wifi.
10
11 cat >/etc/dnsmasq.d/untrusted-network.conf <<'EOF'
12 server=8.8.4.4
13 server=8.8.8.8
14 server=2001:4860:4860::8844
15 server=2001:4860:4860::8888
16 no-resolv
17 # https://ret2got.wordpress.com/2018/01/19/how-your-ethereum-can-be-stolen-using-dns-rebinding/
18 stop-dns-rebind
19 EOF
20
21 systemctl reload dnsmasq