From 7359cdd64a82fc03ddb8592755b7387e0dd54fa9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 7 Dec 2016 16:57:57 +0000 Subject: [PATCH] More dns nameservers --- src/freedombone | 20 ++++++++++++++++++++ src/freedombone-image | 32 ++++++++++++++++++++++++++++++++ src/freedombone-image-make | 10 +++++++++- src/freedombone-image-makefile | 8 ++++++++ src/freedombone-utils-config | 4 ++++ src/freedombone-utils-dns | 8 ++++++++ src/freedombone-utils-network | 2 +- 7 files changed, 82 insertions(+), 2 deletions(-) diff --git a/src/freedombone b/src/freedombone index 59633bda..b886ed88 100755 --- a/src/freedombone +++ b/src/freedombone @@ -219,6 +219,26 @@ else shift NAMESERVER2=$1 ;; + # DNS Nameserver 3 + --ns3) + shift + NAMESERVER3=$1 + ;; + # DNS Nameserver 4 + --ns4) + shift + NAMESERVER4=$1 + ;; + # DNS Nameserver 5 + --ns5) + shift + NAMESERVER5=$1 + ;; + # DNS Nameserver 6 + --ns6) + shift + NAMESERVER6=$1 + ;; # Debian repository --repo) shift diff --git a/src/freedombone-image b/src/freedombone-image index ee63308c..d5ce9c15 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -85,6 +85,10 @@ BOX_IP_ADDRESS="192.168.1.55" # DNS NAMESERVER1='213.73.91.35' NAMESERVER2='85.214.20.141' +NAMESERVER3='213.73.91.35' +NAMESERVER4='85.214.73.63' +NAMESERVER5='8.8.8.8' +NAMESERVER6='4.4.4.4' # An optional freedombone configuration file CONFIG_FILENAME= @@ -274,6 +278,10 @@ function mesh_router_setup_script { echo 'DEBIAN_REPO=' >> $mesh_script_filename echo 'NAMESERVER1=' >> $mesh_script_filename echo 'NAMESERVER2=' >> $mesh_script_filename + echo 'NAMESERVER3=' >> $mesh_script_filename + echo 'NAMESERVER4=' >> $mesh_script_filename + echo 'NAMESERVER5=' >> $mesh_script_filename + echo 'NAMESERVER6=' >> $mesh_script_filename echo 'BATMAN_CELLID=any' >> $mesh_script_filename echo 'WIFI_CHANNEL=9' >> $mesh_script_filename } @@ -340,6 +348,26 @@ do shift NAMESERVER2="$1" ;; + # nameserver 3 + --ns3|--nameserver3) + shift + NAMESERVER2="$1" + ;; + # nameserver 4 + --ns4|--nameserver4) + shift + NAMESERVER4="$1" + ;; + # nameserver 5 + --ns5|--nameserver5) + shift + NAMESERVER5="$1" + ;; + # nameserver 6 + --ns6|--nameserver6) + shift + NAMESERVER6="$1" + ;; -i|--interactive) shift INTERACTIVE="$1" @@ -526,6 +554,10 @@ make $IMAGE_TYPE \ BOX_IP_ADDRESS="$BOX_IP_ADDRESS" \ NAMESERVER1="$NAMESERVER1" \ NAMESERVER2="$NAMESERVER2" \ + NAMESERVER3="$NAMESERVER3" \ + NAMESERVER4="$NAMESERVER4" \ + NAMESERVER5="$NAMESERVER5" \ + NAMESERVER6="$NAMESERVER6" \ PROJECT_NAME="$PROJECT_NAME" \ CONFIG_FILENAME="$CONFIG_FILENAME" \ IMAGE_SIZE="$IMAGE_SIZE" \ diff --git a/src/freedombone-image-make b/src/freedombone-image-make index 8861f9d4..5ba5fe77 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -54,6 +54,10 @@ export ROUTER_IP_ADDRESS export BOX_IP_ADDRESS export NAMESERVER1 export NAMESERVER2 +export NAMESERVER3 +export NAMESERVER4 +export NAMESERVER5 +export NAMESERVER6 export PROJECT_NAME export CONFIG_FILENAME export SSH_PUBKEY @@ -200,7 +204,11 @@ fi sed -i "s|ROUTER_IP_ADDRESS=.*|ROUTER_IP_ADDRESS=${ROUTER_IP_ADDRESS}|g" $TEMP_CUSTOMISE3 sed -i "s|BOX_IP_ADDRESS=.*|BOX_IP_ADDRESS=${BOX_IP_ADDRESS}|g" $TEMP_CUSTOMISE3 sed -i "s|NAMESERVER1=.*|NAMESERVER1=${NAMESERVER1}|g" $TEMP_CUSTOMISE3 -sed -i "s|NAMESERVER2=.*|NAMESERVER2=${NAMESERVER1}|g" $TEMP_CUSTOMISE3 +sed -i "s|NAMESERVER2=.*|NAMESERVER2=${NAMESERVER2}|g" $TEMP_CUSTOMISE3 +sed -i "s|NAMESERVER3=.*|NAMESERVER3=${NAMESERVER3}|g" $TEMP_CUSTOMISE3 +sed -i "s|NAMESERVER4=.*|NAMESERVER4=${NAMESERVER4}|g" $TEMP_CUSTOMISE3 +sed -i "s|NAMESERVER5=.*|NAMESERVER5=${NAMESERVER5}|g" $TEMP_CUSTOMISE3 +sed -i "s|NAMESERVER6=.*|NAMESERVER6=${NAMESERVER6}|g" $TEMP_CUSTOMISE3 sed -i "s|PROJECT_NAME=.*|PROJECT_NAME=${PROJECT_NAME}|g" $TEMP_CUSTOMISE3 sed -i "s|CONFIG_FILENAME=.*|CONFIG_FILENAME=${CONFIG_FILENAME}|g" $TEMP_CUSTOMISE3 sed -i "s|SSH_PUBKEY=.*|SSH_PUBKEY=${SSH_PUBKEY}|g" $TEMP_CUSTOMISE3 diff --git a/src/freedombone-image-makefile b/src/freedombone-image-makefile index 57d4d188..7239304b 100755 --- a/src/freedombone-image-makefile +++ b/src/freedombone-image-makefile @@ -62,6 +62,10 @@ BOX_IP_ADDRESS ?= "192.168.1.55" # DNS NAMESERVER1 ?= '213.73.91.35' NAMESERVER2 ?= '85.214.20.141' +NAMESERVER3 ?= '213.73.91.35' +NAMESERVER4 ?= '85.214.73.63' +NAMESERVER5 ?= '8.8.8.8' +NAMESERVER6 ?= '4.4.4.4' # Using taskset to pin build process to single core. This is a # workaround for a qemu-user-static issue that causes builds to @@ -75,6 +79,10 @@ MAKE_IMAGE = ARCHITECTURE=$(ARCHITECTURE) MACHINE=$(MACHINE) SOURCE=$(SOURCE) \ BOX_IP_ADDRESS=$(BOX_IP_ADDRESS) \ NAMESERVER1=$(NAMESERVER1) \ NAMESERVER2=$(NAMESERVER2) \ + NAMESERVER3=$(NAMESERVER3) \ + NAMESERVER4=$(NAMESERVER4) \ + NAMESERVER5=$(NAMESERVER5) \ + NAMESERVER6=$(NAMESERVER6) \ CUSTOM_SETUP=$(CUSTOM_SETUP) \ IMAGE_SIZE=$(IMAGE_SIZE) taskset 0x01 $(PROJECT_NAME)-image-make $(NAME) diff --git a/src/freedombone-utils-config b/src/freedombone-utils-config index cfa6e94a..e1847843 100755 --- a/src/freedombone-utils-config +++ b/src/freedombone-utils-config @@ -51,6 +51,10 @@ configuration_variables=(FRIENDS_MIRRORS_SERVER XMPP_DOMAIN_CODE NAMESERVER1 NAMESERVER2 + NAMESERVER3 + NAMESERVER4 + NAMESERVER5 + NAMESERVER6 GET_IP_ADDRESS_URL DDNS_PROVIDER DDNS_USERNAME diff --git a/src/freedombone-utils-dns b/src/freedombone-utils-dns index 52e6b4a4..1914ab15 100755 --- a/src/freedombone-utils-dns +++ b/src/freedombone-utils-dns @@ -31,6 +31,10 @@ # DNS NAMESERVER1='213.73.91.35' NAMESERVER2='85.214.20.141' +NAMESERVER3='213.73.91.35' +NAMESERVER4='85.214.73.63' +NAMESERVER5='8.8.8.8' +NAMESERVER6='4.4.4.4' # parameters used when adding a new domain DDNS_PROVIDER="default@freedns.afraid.org" @@ -193,6 +197,10 @@ function configure_dns { echo 'search localdomain' >> /etc/resolv.conf echo "nameserver $NAMESERVER1" >> /etc/resolv.conf echo "nameserver $NAMESERVER2" >> /etc/resolv.conf + echo "nameserver $NAMESERVER3" >> /etc/resolv.conf + echo "nameserver $NAMESERVER4" >> /etc/resolv.conf + echo "nameserver $NAMESERVER5" >> /etc/resolv.conf + echo "nameserver $NAMESERVER6" >> /etc/resolv.conf # prevent resolv.conf from changing chattr +i /etc/resolv.conf diff --git a/src/freedombone-utils-network b/src/freedombone-utils-network index 8797d131..929cdf35 100755 --- a/src/freedombone-utils-network +++ b/src/freedombone-utils-network @@ -61,7 +61,7 @@ function install_static_network { echo " address $LOCAL_NETWORK_STATIC_IP_ADDRESS" >> /etc/network/interfaces echo ' netmask 255.255.255.0' >> /etc/network/interfaces echo " gateway $ROUTER_IP_ADDRESS" >> /etc/network/interfaces - echo " dns-nameservers $NAMESERVER1 $NAMESERVER2" >> /etc/network/interfaces + echo " dns-nameservers $NAMESERVER1 $NAMESERVER2 $NAMESERVER3 $NAMESERVER4 $NAMESERVER5 $NAMESERVER6" >> /etc/network/interfaces echo '# Example to keep MAC address between reboots' >> /etc/network/interfaces echo '#hwaddress ether DE:AD:BE:EF:CA:FE' >> /etc/network/interfaces echo '' >> /etc/network/interfaces