mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2025-08-19 12:47:27 +02:00
Compare commits
11 Commits
d7703b6b63
...
764073e241
Author | SHA1 | Date | |
---|---|---|---|
764073e241 | |||
dff016aa45 | |||
f5223b871f | |||
9f2b75368d | |||
1e807e888c | |||
6567488801 | |||
0566ebbbc2 | |||
8f11f1a512 | |||
c751a61146 | |||
71582a9b95 | |||
6900a44b4a |
39
etc/NetworkManager-resolv.conf-restore.bash
Executable file
39
etc/NetworkManager-resolv.conf-restore.bash
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# I learned that not only systemd-resolved does this, but NetworkManager as
|
||||||
|
# well. I think it's even less likely I use this than the systemd-resolved
|
||||||
|
# one, but anyway
|
||||||
|
|
||||||
|
# I know there are old versions that used something else, but I don't remember
|
||||||
|
# that name and they are ancient.
|
||||||
|
if ! hash nmcli 2>/dev/null; then
|
||||||
|
echo "You don't seem to have NetworkManager (or nmcli) installed." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Require root or exit
|
||||||
|
if [ "$(id -u)" != "0" ]; then
|
||||||
|
echo "This script requires root." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# It's pointless to make a dead symlink as it must be running
|
||||||
|
systemctl enable --now NetworkManager.service
|
||||||
|
|
||||||
|
# In case I am behind the /etc/resolv.conf, it's immutable and read-only,
|
||||||
|
# which won't allow it to be rewritten.
|
||||||
|
chattr -V -i /etc/resolv.conf
|
||||||
|
chmod -v +w /etc/resolv.conf
|
||||||
|
|
||||||
|
# It must be removed if it's not a symlink
|
||||||
|
rm -v /etc/resolv.conf
|
||||||
|
|
||||||
|
# and finally making the symlink
|
||||||
|
ln -sfv /var/run/NetworkManager/resolv.conf /etc/resolv.conf
|
||||||
|
|
||||||
|
# Let's just see it's ok
|
||||||
|
ls -l /etc/resolv.conf
|
||||||
|
cat /etc/resolv.conf
|
||||||
|
|
||||||
|
set +x
|
1
etc/NetworkManager/conf.d/.gitignore
vendored
1
etc/NetworkManager/conf.d/.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
dns-none.conf
|
|
||||||
no-resolvconf.conf
|
no-resolvconf.conf
|
||||||
|
@ -8,3 +8,5 @@ interval=100
|
|||||||
# sudo apt install network-manager-config-connectivity-debian
|
# sudo apt install network-manager-config-connectivity-debian
|
||||||
# for /usr/lib/NetworkManager/conf.d/20-connectivity-debian.conf
|
# for /usr/lib/NetworkManager/conf.d/20-connectivity-debian.conf
|
||||||
# (http://network-test.debian.org/nm without interval)
|
# (http://network-test.debian.org/nm without interval)
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -1 +0,0 @@
|
|||||||
paws-off-my-resolv.conf
|
|
8
etc/NetworkManager/conf.d/dns-none.conf
Normal file
8
etc/NetworkManager/conf.d/dns-none.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[main]
|
||||||
|
# No managing DNS, no managing resolv.conf (implied made explicit here) and
|
||||||
|
# don't push data to systemd-resolved either.
|
||||||
|
dns=none
|
||||||
|
rc-manager=unmanaged
|
||||||
|
systemd-resolved=false
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
@ -2,3 +2,5 @@
|
|||||||
[connection]
|
[connection]
|
||||||
# Enable IPv6 privacy extensions, but this doesn't seem to work.
|
# Enable IPv6 privacy extensions, but this doesn't seem to work.
|
||||||
ipv6.ip6-privacy=2
|
ipv6.ip6-privacy=2
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -9,3 +9,5 @@
|
|||||||
[device]
|
[device]
|
||||||
wifi.backend=iwd
|
wifi.backend=iwd
|
||||||
wifi.iwd.autoconnect=true
|
wifi.iwd.autoconnect=true
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -2,3 +2,5 @@
|
|||||||
# Disable misbehaving NIC
|
# Disable misbehaving NIC
|
||||||
#unmanaged-devices=mac:xx:xx:xx:xx:xx:xx
|
#unmanaged-devices=mac:xx:xx:xx:xx:xx:xx
|
||||||
#hostname=HOSTNAME_TO_SEND_TO_DHCPD
|
#hostname=HOSTNAME_TO_SEND_TO_DHCPD
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
# Brings /etc/network/interfaces(.d/*) under control of NetworkManager
|
# Brings /etc/network/interfaces(.d/*) under control of NetworkManager
|
||||||
[ifupdown]
|
[ifupdown]
|
||||||
managed=true
|
managed=true
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -2,3 +2,5 @@
|
|||||||
[connection]
|
[connection]
|
||||||
connection.mdns=2
|
connection.mdns=2
|
||||||
connection.llmnr=2
|
connection.llmnr=2
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -2,3 +2,5 @@
|
|||||||
# network.
|
# network.
|
||||||
[device]
|
[device]
|
||||||
wifi.scan-rand-mac-address=no
|
wifi.scan-rand-mac-address=no
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
# This should stop search domains from being used and potentially leaking
|
# This should stop search domains from being used and potentially leaking
|
||||||
# queries to search domain DNS server when they fail
|
# queries to search domain DNS server when they fail
|
||||||
[global-dns]
|
[global-dns]
|
||||||
searches=
|
#searches=
|
||||||
|
# I am doubtful of the above being enough
|
||||||
|
searches=.
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
6
etc/NetworkManager/conf.d/no-systemd-resolved.conf
Normal file
6
etc/NetworkManager/conf.d/no-systemd-resolved.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[main]
|
||||||
|
# Don't tell systemd-resolved DNS information aquired from DHCP.
|
||||||
|
systemd-resolved=false
|
||||||
|
# NOTE! This file doesn't comment on how resolv.conf (rc) is managed
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
@ -1,2 +1,8 @@
|
|||||||
[main]
|
[main]
|
||||||
dns=none
|
# dns=none would disable all DNS management by NetworkManager, while the goal
|
||||||
|
# here is to just not touch my resolv.conf. This implies NetworkManager may
|
||||||
|
# still send data to systemd-resolved.
|
||||||
|
#dns=none
|
||||||
|
rc-manager=unmanaged
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -1,2 +1,10 @@
|
|||||||
[main]
|
[main]
|
||||||
|
# Send data to systemd-resolved
|
||||||
dns=systemd-resolved
|
dns=systemd-resolved
|
||||||
|
# Even if I use systemd-resolved, I don't want NetworkManager to touch my
|
||||||
|
# resolv.conf
|
||||||
|
rc-manager=none
|
||||||
|
# Implied, but made explicit
|
||||||
|
systemd-resolved=true
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -3,3 +3,5 @@
|
|||||||
# again seems to expect unbound-control-setup to be done/enabled
|
# again seems to expect unbound-control-setup to be done/enabled
|
||||||
[main]
|
[main]
|
||||||
dns=unbound
|
dns=unbound
|
||||||
|
|
||||||
|
# vim: filetype=NetworkManager.conf
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
#
|
#
|
||||||
##### BEGIN AMINDA BLOCKLIST #####
|
##### BEGIN AMINDA BLOCKLIST #####
|
||||||
|
|
||||||
|
# NOTE! systemd-resolved will automatically make ::1 also 127.0.0.1
|
||||||
|
|
||||||
# Facebook API that a lot of things call, will break things for Facebook
|
# Facebook API that a lot of things call, will break things for Facebook
|
||||||
# users, so don't apply on hosts those use
|
# users, so don't apply on hosts those use
|
||||||
:: graph.facebook.com
|
::1 graph.facebook.com
|
||||||
0.0.0.0 graph.facebook.com
|
|
||||||
|
|
||||||
# Unnecessary service for Matrix rooms. I was dared to block it.
|
# Unnecessary service for Matrix rooms. I was dared to block it.
|
||||||
:: matrix.to www.matrix.to
|
::1 matrix.to www.matrix.to
|
||||||
0.0.0.0 matrix.to www.matrix.to
|
|
||||||
|
|
||||||
##### END AMINDA BLOCKLIST #####
|
##### END AMINDA BLOCKLIST #####
|
||||||
#
|
#
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
# Well known DNS servers to be appended to /etc/hosts
|
# Well known DNS servers to be appended to /etc/hosts
|
||||||
|
|
||||||
# Quad 9 Secure
|
# Quad 9 Recommended (Secure)
|
||||||
9.9.9.9 dns.quad9.net
|
9.9.9.9 dns.quad9.net dns9.quad9.net
|
||||||
149.112.112.112 dns.quad9.net
|
149.112.112.112 dns.quad9.net dns9.quad9.net
|
||||||
2620:fe::fe dns.quad9.net
|
2620:fe::fe dns.quad9.net dns9.quad9.net
|
||||||
2620:fe::9 dns.quad9.net
|
2620:fe::9 dns.quad9.net dns9.quad9.net
|
||||||
|
|
||||||
# Quad9 No Threat Blocking
|
# Quad9 No Threat Blocking
|
||||||
9.9.9.10 dns10.quad9.net
|
9.9.9.10 dns10.quad9.net
|
||||||
@ -30,26 +30,50 @@
|
|||||||
# DNS0 default
|
# DNS0 default
|
||||||
193.110.81.0 dns0.eu
|
193.110.81.0 dns0.eu
|
||||||
185.253.5.0 dns0.eu
|
185.253.5.0 dns0.eu
|
||||||
2a0f:fc80:: dns0.eu
|
# Uses private ECS, which gets inaccurate with IPv6 directing traffic to
|
||||||
2a0f:fc81:: dns0.eu
|
# other side of the country at best and different country at worst. Thus
|
||||||
|
# attempt to make everything only use it for IPv4 (browser fallback is system
|
||||||
|
# resolver which does IPv6 if IPv4 breaks, even if ECH will break).
|
||||||
|
#2a0f:fc80:: dns0.eu
|
||||||
|
#2a0f:fc81:: dns0.eu
|
||||||
|
::ffff:193.110.81.0 dns0.eu
|
||||||
|
::ffff:185.253.5.0 dns0.eu
|
||||||
|
|
||||||
# DNS0 Zero
|
# DNS0 Zero
|
||||||
193.110.81.9 zero.dns0.eu
|
193.110.81.9 zero.dns0.eu
|
||||||
185.253.5.9 zero.dns0.eu
|
185.253.5.9 zero.dns0.eu
|
||||||
2a0f:fc80::9 zero.dns0.eu
|
# Uses private ECS, which gets inaccurate with IPv6 directing traffic to
|
||||||
2a0f:fc81::9 zero.dns0.eu
|
# other side of the country at best and different country at worst. Thus
|
||||||
|
# attempt to make everything only use it for IPv4 (browser fallback is system
|
||||||
|
# resolver which does IPv6 if IPv4 breaks, even if ECH will break).
|
||||||
|
#2a0f:fc80::9 zero.dns0.eu
|
||||||
|
#2a0f:fc81::9 zero.dns0.eu
|
||||||
|
::ffff:193.110.81.9 zero.dns0.eu
|
||||||
|
::ffff:185.253.5.9 zero.dns0.eu
|
||||||
|
|
||||||
# DNS0 Kids
|
# DNS0 Kids
|
||||||
193.110.81.1 kids.dns0.eu
|
193.110.81.1 kids.dns0.eu
|
||||||
185.253.5.1 kids.dns0.eu
|
185.253.5.1 kids.dns0.eu
|
||||||
2a0f:fc80::1 kids.dns0.eu
|
# Uses private ECS, which gets inaccurate with IPv6 directing traffic to
|
||||||
2a0f:fc81::1 kids.dns0.eu
|
# other side of the country at best and different country at worst. Thus
|
||||||
|
# attempt to make everything only use it for IPv4 (browser fallback is system
|
||||||
|
# resolver which does IPv6 if IPv4 breaks, even if ECH will break).
|
||||||
|
#2a0f:fc80::1 kids.dns0.eu
|
||||||
|
#2a0f:fc81::1 kids.dns0.eu
|
||||||
|
::ffff:193.110.81.1 kids.dns0.eu
|
||||||
|
::ffff:185.253.5.1 kids.dns0.eu
|
||||||
|
|
||||||
# DNS0 Open
|
# DNS0 Open
|
||||||
193.110.81.254 open.dns0.eu
|
193.110.81.254 open.dns0.eu
|
||||||
185.253.5.254 open.dns0.eu
|
185.253.5.254 open.dns0.eu
|
||||||
2a0f:fc80::ffff open.dns0.eu
|
# Uses private ECS, which gets inaccurate with IPv6 directing traffic to
|
||||||
2a0f:fc81::ffff open.dns0.eu
|
# other side of the country at best and different country at worst. Thus
|
||||||
|
# attempt to make everything only use it for IPv4 (browser fallback is system
|
||||||
|
# resolver which does IPv6 if IPv4 breaks, even if ECH will break).
|
||||||
|
#2a0f:fc80::ffff open.dns0.eu
|
||||||
|
#2a0f:fc81::ffff open.dns0.eu
|
||||||
|
::ffff:193.110.81.254 open.dns0.eu
|
||||||
|
::ffff:185.253.5.254 open.dns0.eu
|
||||||
|
|
||||||
# Cloudflare
|
# Cloudflare
|
||||||
1.1.1.1 cloudflare-dns.com one.one.one.one
|
1.1.1.1 cloudflare-dns.com one.one.one.one
|
||||||
@ -69,8 +93,14 @@
|
|||||||
# AdGuard Default
|
# AdGuard Default
|
||||||
94.140.14.14 dns.adguard-dns.com
|
94.140.14.14 dns.adguard-dns.com
|
||||||
94.140.15.15 dns.adguard-dns.com
|
94.140.15.15 dns.adguard-dns.com
|
||||||
2a10:50c0::ad1:ff dns.adguard-dns.com
|
# Uses private ECS, which gets inaccurate with IPv6 directing traffic to
|
||||||
2a10:50c0::ad2:ff dns.adguard-dns.com
|
# other side of the country at best and different country at worst. Thus
|
||||||
|
# attempt to make everything only use it for IPv4 (browser fallback is system
|
||||||
|
# resolver which does IPv6 if IPv4 breaks, even if ECH will break).
|
||||||
|
#2a10:50c0::ad1:ff dns.adguard-dns.com
|
||||||
|
#2a10:50c0::ad2:ff dns.adguard-dns.com
|
||||||
|
::ffff:94.140.14.14 dns.adguard-dns.com
|
||||||
|
::ffff:94.140.15.15 dns.adguard-dns.com
|
||||||
|
|
||||||
# Google DNS
|
# Google DNS
|
||||||
8.8.8.8 dns.google dns.google.com
|
8.8.8.8 dns.google dns.google.com
|
||||||
|
Loading…
x
Reference in New Issue
Block a user