Skip to content

Instantly share code, notes, and snippets.

@kdiogenes
Created February 27, 2016 12:47
Show Gist options
  • Select an option

  • Save kdiogenes/30bb776dd6a8f32cffd1 to your computer and use it in GitHub Desktop.

Select an option

Save kdiogenes/30bb776dd6a8f32cffd1 to your computer and use it in GitHub Desktop.
fish: functions to switch named forwaders
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