Skip to content

Instantly share code, notes, and snippets.

@mikedamm
Last active August 24, 2024 03:08
Show Gist options
  • Save mikedamm/82958f9af8640395f3f276af92aaf980 to your computer and use it in GitHub Desktop.
Save mikedamm/82958f9af8640395f3f276af92aaf980 to your computer and use it in GitHub Desktop.
Fix systemd-resolved so it does not bind port 53
#!/bin/bash
#
# curl https://gist.githubusercontent.com/mikedamm/82958f9af8640395f3f276af92aaf980/raw/fuckyousystemd.sh | bash
#
echo "Before"
lsof -i -P -n | grep LISTEN | grep ':53'
sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf && \
sh -c 'rm /etc/resolv.conf && ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf' && \
systemctl restart systemd-resolved
echo "After"
lsof -i -P -n | grep LISTEN | grep ':53'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment