Use resolvconf for dns resolution
This commit is contained in:
parent
6b74243de2
commit
9d4858c07e
|
@ -178,6 +178,8 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_networking() {
|
configure_networking() {
|
||||||
|
chroot "$rootdir" apt-get -yq install resolvconf
|
||||||
|
|
||||||
if [[ "$MACHINE" == "beaglebonewifi" ]]; then
|
if [[ "$MACHINE" == "beaglebonewifi" ]]; then
|
||||||
# Allow networking over USB in order to configure the
|
# Allow networking over USB in order to configure the
|
||||||
# wifi login settings
|
# wifi login settings
|
||||||
|
@ -244,7 +246,7 @@ iface eth0 inet static
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# configure DNS
|
# configure DNS
|
||||||
resolvconf=$rootdir/etc/resolv.conf
|
resolvconf=$rootdir/etc/resolvconf/resolv.conf.d/head
|
||||||
echo 'domain localdomain' > $resolvconf
|
echo 'domain localdomain' > $resolvconf
|
||||||
echo 'search localdomain' >> $resolvconf
|
echo 'search localdomain' >> $resolvconf
|
||||||
echo "nameserver $NAMESERVER1" >> $resolvconf
|
echo "nameserver $NAMESERVER1" >> $resolvconf
|
||||||
|
@ -253,6 +255,7 @@ iface eth0 inet static
|
||||||
echo "nameserver $NAMESERVER4" >> $resolvconf
|
echo "nameserver $NAMESERVER4" >> $resolvconf
|
||||||
echo "nameserver $NAMESERVER5" >> $resolvconf
|
echo "nameserver $NAMESERVER5" >> $resolvconf
|
||||||
echo "nameserver $NAMESERVER6" >> $resolvconf
|
echo "nameserver $NAMESERVER6" >> $resolvconf
|
||||||
|
chroot "$rootdir" resolvconf -u
|
||||||
|
|
||||||
if [[ $VARIANT != "meshclient" && $VARIANT != "meshusb" ]]; then
|
if [[ $VARIANT != "meshclient" && $VARIANT != "meshusb" ]]; then
|
||||||
# change the motd to show further install instructions
|
# change the motd to show further install instructions
|
||||||
|
|
|
@ -316,7 +316,7 @@ function read_configuration_values {
|
||||||
|
|
||||||
if grep -q "DEBIAN_REPO" $CONFIGURATION_FILE; then
|
if grep -q "DEBIAN_REPO" $CONFIGURATION_FILE; then
|
||||||
read_config_param "DEBIAN_REPO"
|
read_config_param "DEBIAN_REPO"
|
||||||
CHECK_MESSAGE=$"Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list."
|
CHECK_MESSAGE=$"Check your internet connection, /etc/network/interfaces and /etc/resolvconf/resolv.conf.d/head, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,9 @@ function configure_dns {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
resolvconf=/etc/resolv.conf
|
apt-get -yq install resolvconf
|
||||||
|
|
||||||
|
resolvconf=/etc/resolvconf/resolv.conf.d/head
|
||||||
|
|
||||||
# allow changes to resolv.conf
|
# allow changes to resolv.conf
|
||||||
chattr -i $resolvconf
|
chattr -i $resolvconf
|
||||||
|
@ -211,7 +213,7 @@ function configure_dns {
|
||||||
echo "nameserver $NAMESERVER6" >> $resolvconf
|
echo "nameserver $NAMESERVER6" >> $resolvconf
|
||||||
|
|
||||||
# prevent resolv.conf from changing
|
# prevent resolv.conf from changing
|
||||||
chattr +i $resolvconf
|
resolvconf -u
|
||||||
|
|
||||||
mark_completed $FUNCNAME
|
mark_completed $FUNCNAME
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,10 +310,9 @@ function resolve_dns_via_tor {
|
||||||
sed -i 's|, domain-name-servers||g' /etc/dhcp/dhclient.conf
|
sed -i 's|, domain-name-servers||g' /etc/dhcp/dhclient.conf
|
||||||
|
|
||||||
# point resolv.conf to tor
|
# point resolv.conf to tor
|
||||||
resolvconf=/etc/resolv.conf
|
resolvconf=/etc/resolvconf/resolv.conf.d/head
|
||||||
chattr -i $resolvconf
|
|
||||||
echo 'nameserver 127.0.0.1:53' > $resolvconf
|
echo 'nameserver 127.0.0.1:53' > $resolvconf
|
||||||
chattr +i $resolvconf
|
resolvconf -u
|
||||||
|
|
||||||
mark_completed $FUNCNAME
|
mark_completed $FUNCNAME
|
||||||
}
|
}
|
||||||
|
@ -378,12 +377,11 @@ function route_outgoing_traffic_through_tor {
|
||||||
/sbin/sysctl -p -q
|
/sbin/sysctl -p -q
|
||||||
fi
|
fi
|
||||||
|
|
||||||
resolvconf=/etc/resolv.conf
|
resolvconf=/etc/resolvconf/resolv.conf.d/head
|
||||||
chattr -i $resolvconf
|
|
||||||
echo 'domain localdomain' > $resolvconf
|
echo 'domain localdomain' > $resolvconf
|
||||||
echo 'search localdomain' >> $resolvconf
|
echo 'search localdomain' >> $resolvconf
|
||||||
echo 'nameserver 127.0.0.1' >> $resolvconf
|
echo 'nameserver 127.0.0.1' >> $resolvconf
|
||||||
chattr +i $resolvconf
|
resolvconf -u
|
||||||
|
|
||||||
if ! grep -q "VirtualAddrNetworkIPv4" /etc/tor/torrc; then
|
if ! grep -q "VirtualAddrNetworkIPv4" /etc/tor/torrc; then
|
||||||
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >> /etc/tor/torrc
|
echo 'VirtualAddrNetworkIPv4 10.192.0.0/10' >> /etc/tor/torrc
|
||||||
|
|
|
@ -80,7 +80,7 @@ COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||||
REMOTE_BACKUPS_LOG=/var/log/remotebackups.log
|
REMOTE_BACKUPS_LOG=/var/log/remotebackups.log
|
||||||
|
|
||||||
# message if something fails to install
|
# message if something fails to install
|
||||||
CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/resolv.conf, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list."
|
CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/resolvconf/resolv.conf.d/head, then delete $COMPLETION_FILE, run 'rm -fR /var/lib/apt/lists/* && apt-get update --fix-missing' and run this script again. If hash sum mismatches persist then try setting $DEBIAN_REPO to a different mirror and also change /etc/apt/sources.list."
|
||||||
|
|
||||||
# Default diffie-hellman key length in bits
|
# Default diffie-hellman key length in bits
|
||||||
DH_KEYLENGTH=2048
|
DH_KEYLENGTH=2048
|
||||||
|
|
|
@ -466,8 +466,6 @@ function networks_from_file {
|
||||||
fi
|
fi
|
||||||
done < $WIFI_NETWORKS_FILE
|
done < $WIFI_NETWORKS_FILE
|
||||||
|
|
||||||
resolvconf=/etc/resolv.conf
|
|
||||||
chattr -i $resolvconf
|
|
||||||
systemctl restart network-manager
|
systemctl restart network-manager
|
||||||
#ifconfig ${WIFI_INTERFACE} up
|
#ifconfig ${WIFI_INTERFACE} up
|
||||||
ifup $WIFI_INTERFACE
|
ifup $WIFI_INTERFACE
|
||||||
|
|
Loading…
Reference in New Issue