# Usage: use when switching from a trusted network to an untrusted one,
# like public wifi.
-cat >/etc/dnsmasq.d/untrusted-network.conf <<'EOF'
+if [[ ! -s /etc/dnsmasq.d/untrusted-network.conf ]]; then
+ cat >/etc/dnsmasq.d/untrusted-network.conf <<'EOF'
server=8.8.4.4
server=8.8.8.8
server=2001:4860:4860::8844
stop-dns-rebind
EOF
-systemctl reload dnsmasq
+ nscd -i hosts
+ systemctl restart dnsmasq
+fi