Skip to content

Commit

Permalink
Made upstream DNS server configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
bentasker committed Apr 24, 2015
1 parent be0a755 commit 88fcc3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/config
@@ -0,0 +1 @@
UPSTREAM_DNS='8.8.4.4'
3 changes: 2 additions & 1 deletion scripts/add_vpn_routing_by_name.sh
Expand Up @@ -30,10 +30,11 @@ fi
# Load the config
source /root/.vpn_config

source $INSTDIR/config/config

# Run a nameserver lookup on the domain

IPS=$( host `echo $DNFIELD 8.8.4.4 | awk -F\: '{print $1}'` | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' );
IPS=$( host `echo $DNFIELD $UPSTREAM_DNS | awk -F\: '{print $1}'` | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' );

for i in $IPS
do
Expand Down
3 changes: 2 additions & 1 deletion scripts/process_rules.sh
Expand Up @@ -18,6 +18,7 @@
source /root/.vpn_config

# Handle the predefined IPs
source $INSTDIR/config/config
source $INSTDIR/config/routes
source $INSTDIR/config/firewall

Expand All @@ -28,7 +29,7 @@ while read -r DNFIELD
do

# Run a nameserver lookup on the domain
IPS=$( host `echo $DNFIELD 8.8.4.4 | awk -F\: '{print $1}'` | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' );
IPS=$( host `echo $DNFIELD $UPSTREAM_DNS | awk -F\: '{print $1}'` | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' );
GW=$(echo $DNFIELD | awk -F\: '{print $2}')
NAT=$(echo $DNFIELD | awk -F\: '{print $2}')

Expand Down

0 comments on commit 88fcc3c

Please sign in to comment.