Created
July 28, 2020 09:09
-
-
Save k0nsl/412e5782462aceefd649a5040be9bff4 to your computer and use it in GitHub Desktop.
A sort of "set and forget" type of operation in order to not have your resolv.conf overwritten; uses two Danish resolvers (unicast and anycast respectively). Can be run once or placed in "/etc/cron.hourly" as "keep-resolvconf" -- remember to make it executable too. That is all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## this file can live in /etc/cron.hourly as "keep-resolvers". | |
sudo chattr -i /etc/resolv.conf | |
sudo chattr -e /etc/resolv.conf | |
sudo rm -f /etc/resolv.conf | |
sudo touch /etc/resolv.conf.tmp | |
sudo echo "nameserver 91.239.100.100" >> /etc/resolv.conf.tmp | |
sudo echo "nameserver 89.233.43.71" >> /etc/resolv.conf.tmp | |
sudo cp /etc/resolv.conf.tmp /etc/resolv.conf | |
sudo chattr +i /etc/resolv.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment