From 5d0f94846127681f736668da42691a6f5c5d008a Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Tue, 14 Feb 2023 17:04:01 -0800 Subject: [PATCH] Init DNS switching scripts --- homelab/router/scripts/dns_cloudflare.sh | 16 ++++++++++++++++ homelab/router/scripts/dns_pihole.sh | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 homelab/router/scripts/dns_cloudflare.sh create mode 100644 homelab/router/scripts/dns_pihole.sh diff --git a/homelab/router/scripts/dns_cloudflare.sh b/homelab/router/scripts/dns_cloudflare.sh new file mode 100644 index 00000000..4cf9feac --- /dev/null +++ b/homelab/router/scripts/dns_cloudflare.sh @@ -0,0 +1,16 @@ +#!/bin/vbash +# https://docs.vyos.io/en/equuleus/automation/command-scripting.html +source /opt/vyatta/etc/functions/script-template +configure + +delete service dns forwarding name-server 192.168.1.21 +delete service dns forwarding name-server 192.168.1.22 +set service dns forwarding name-server 1.1.1.1 + +delete service dhcp-server shared-network-name LAN name-server 192.168.1.21 +delete service dhcp-server shared-network-name LAN name-server 192.168.1.22 +set service dhcp-server shared-network-name LAN name-server 192.168.1.1 + +commit +save +exit \ No newline at end of file diff --git a/homelab/router/scripts/dns_pihole.sh b/homelab/router/scripts/dns_pihole.sh new file mode 100644 index 00000000..f0d1d173 --- /dev/null +++ b/homelab/router/scripts/dns_pihole.sh @@ -0,0 +1,16 @@ +#!/bin/vbash +# https://docs.vyos.io/en/equuleus/automation/command-scripting.html +source /opt/vyatta/etc/functions/script-template +configure + +delete service dns forwarding name-server 1.1.1.1 +set service dns forwarding name-server 192.168.1.21 +set service dns forwarding name-server 192.168.1.22 + +delete service dhcp-server shared-network-name LAN name-server 192.168.1.1 +set service dhcp-server shared-network-name LAN name-server 192.168.1.21 +set service dhcp-server shared-network-name LAN name-server 192.168.1.22 + +commit +save +exit \ No newline at end of file