Created
February 27, 2016 12:47
-
-
Save kdiogenes/30bb776dd6a8f32cffd1 to your computer and use it in GitHub Desktop.
fish: functions to switch named forwaders
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
| function named_home | |
| sudo sed -e 's/ \/\/forwarders { 8.8.8.8; 8.8.4.4; };/ forwarders { 8.8.8.8; 8.8.4.4; };/' /etc/named.conf | sed -e 's/ forwarders { corporate_dns_1; corporate_dns_2; };/ \/\/forwarders { corporate_dns_1; corporate_dns_2; };/' > /tmp/named.conf.tmp; sudo mv /tmp/named.conf.tmp /etc/named.conf | |
| sudo systemctl stop named | |
| sudo systemctl start named | |
| end | |
| function named_unioeste | |
| sudo sed -e 's/ forwarders { 8.8.8.8; 8.8.4.4; };/ \/\/forwarders { 8.8.8.8; 8.8.4.4; };/' /etc/named.conf | sudo sed -e 's/ \/\/forwarders { corporate_dns_1; corporate_dns_2; };/ forwarders { corporate_dns_1; corporate_dns_2; };/' > /tmp/named.conf.tmp; sudo mv /tmp/named.conf.tmp /etc/named.conf | |
| sudo systemctl stop named | |
| sudo systemctl start named | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment