Skip to content

Commit

Permalink
Try to fix DNS (privacy) issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKaiser committed Aug 24, 2018
1 parent e358089 commit f10acc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/chroot-buildpackages.sh
Expand Up @@ -59,7 +59,6 @@ create_chroot()
printf '#!/bin/sh\nexit 101' > $target_dir/usr/sbin/policy-rc.d
chmod 755 $target_dir/usr/sbin/policy-rc.d
rm $target_dir/etc/resolv.conf 2>/dev/null
echo "1.1.1.1" > $target_dir/etc/resolv.conf
rm $target_dir/etc/hosts 2>/dev/null
echo "127.0.0.1 localhost" > $target_dir/etc/hosts
mkdir -p $target_dir/root/{build,overlay,sources} $target_dir/selinux
Expand Down
7 changes: 2 additions & 5 deletions lib/distributions.sh
Expand Up @@ -199,7 +199,8 @@ install_common()

# DNS fix. package resolvconf is not available everywhere
if [ -d /etc/resolvconf/resolv.conf.d ]; then
echo 'nameserver 1.1.1.1' > $SDCARD/etc/resolvconf/resolv.conf.d/head
echo -e "# In case of DNS problems, try uncommenting this and reboot for debugging\n# nameserver 1.1.1.1" \
> $SDCARD/etc/resolvconf/resolv.conf.d/head
fi

# premit root login via SSH for the first boot
Expand Down Expand Up @@ -265,8 +266,6 @@ install_distribution_specific()
exit 0
EOF
chmod +x $SDCARD/etc/rc.local
# DNS fix
sed -i "s/#DNS=.*/DNS=1.1.1.1/g" $SDCARD/etc/systemd/resolved.conf
;;
bionic)
# remove doubled uname from motd
Expand Down Expand Up @@ -297,8 +296,6 @@ install_distribution_specific()
version: 2
renderer: NetworkManager
EOF
# DNS fix
sed -i "s/#DNS=.*/DNS=1.1.1.1/g" $SDCARD/etc/systemd/resolved.conf
# Journal service adjustements
sed -i "s/#Storage=.*/Storage=volatile/g" $SDCARD/etc/systemd/journald.conf
sed -i "s/#Compress=.*/Compress=yes/g" $SDCARD/etc/systemd/journald.conf
Expand Down
7 changes: 7 additions & 0 deletions packages/bsp/common/usr/lib/armbian/armbian-firstrun
Expand Up @@ -56,6 +56,13 @@ case "$1" in
/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
fi

# check whether DNS resolution works, if not switch to Cloudflare DNS
fping cloudflare.com >/dev/null 2>&1
if [ $? -ne 0 ]; then
sed -i "s/#DNS=.*/DNS=1.1.1.1/" /etc/systemd/resolved.conf
sed -i "s/# nameserver.*/nameserver 1.1.1.1/" /etc/resolvconf/resolv.conf.d/head
fi

# some hardware workarounds
case $LINUXFAMILY in
sun7i|sun8i)
Expand Down

0 comments on commit f10acc0

Please sign in to comment.