Skip to content

Commit

Permalink
Merge pull request #318 from mekanix/feature/automatic-dns
Browse files Browse the repository at this point in the history
Let DHCP set resolv.conf
  • Loading branch information
mekanix authored Apr 14, 2023
2 parents a1bb595 + e3454a2 commit f0d78e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions scripts/base-network-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ dns() {
jexec ${SERVICE} usr/local/bin/reggae-register.sh ipv6 add ${IPV6_PREFIX}${MASTER_IP6} @ ${DOMAIN}
jexec ${SERVICE} /usr/local/bin/reggae-register.sh ipv6 add ${IPV6_PREFIX}${MASTER_IP6} network ${DOMAIN}
fi
echo "search $(hostname)" >"${BASE_WORKDIR}/${SERVICE}/etc/resolv.conf"
if [ "${USE_IPV4}" = "yes" ]; then
echo "nameserver 127.0.01" >>"${BASE_WORKDIR}/${SERVICE}/etc/resolv.conf"
fi
if [ "${USE_IPV6}" = "yes" ]; then
echo "nameserver ::1" >>"${BASE_WORKDIR}/${SERVICE}/etc/resolv.conf"
fi
}


Expand Down
9 changes: 1 addition & 8 deletions scripts/mkjail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,7 @@ if [ "${NAME}" = "network" ]; then
sed -e "s;HOST;${HOST};g" \
-e "s;BASE_WORKDIR;${BASE_WORKDIR};g" \
-e "s;INTERFACE;${INTERFACE};g" \
"${SCRIPT_DIR}/../templates/network-jail.conf" >"/etc/jail.conf.d/${NAME}.conf"
echo "search $(hostname)" >"${BSDINSTALL_CHROOT}/etc/resolv.conf"
if [ "${USE_IPV4}" = "yes" ]; then
echo "nameserver ${INTERFACE_IP}" >>"${BSDINSTALL_CHROOT}/etc/resolv.conf"
fi
if [ "${USE_IPV6}" = "yes" ]; then
echo "nameserver ${IPV6_PREFIX}${INTERFACE_IP6}" >>"${BSDINSTALL_CHROOT}/etc/resolv.conf"
fi
"${SCRIPT_DIR}/../templates/network-jail.conf" >"/etc/jail.conf.d/${NAME}.conf"
else
MOUNTS=$(get_mounts)
DEPENDS=$(get_dependencies)
Expand Down

0 comments on commit f0d78e1

Please sign in to comment.