Codebase list debootstick / f172aab
guest resolv.conf: put both host name servers and public ones Etienne Dublé 1 year, 6 months ago
3 changed file(s) with 23 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
287287 echo -n "I: draft image - generating fstab... "
288288 generate_fstab "$layout_dir"
289289 echo done
290
291 # copy host resolv.conf to help generating a proper one in guest
292 cp /etc/resolv.conf etc/resolv.conf.host
290293
291294 mkdir -p opt/debootstick
292295 cp -a $DBSTCK_DIR/scripts/live opt/debootstick/live
3434 resolv_conf_orig_status=$(ensure_valid_resolv_conf)
3535 if [ "$resolv_conf_orig_status" != "ok" ]
3636 then
37 echo -n "I: draft image - generated /etc/resolv.conf (it was missing or incomplete)"
37 echo "I: draft image - generated /etc/resolv.conf (it was missing or incomplete)"
3838 fi
3939
4040 if $target_custom_packages_exists
7676 # if debootstick has to install one missing package including a DNS
7777 # resolver (e.g. systemd). In any case this file is needed right
7878 # know for the package downloading to succeed.
79 # We copy the name servers which were used on the host and also add
80 # a few public ones.
81 # The one on the host may be '127.0.0.1' (e.g. the host may be running
82 # a local service, e.g., for caching) which will work when the image
83 # is being built but not when the target image is booted.
84 # On the other hand the public nameservers may be unreachable because
85 # of firewalling.
86 # That's why we indicate all of them for more robustness.
7987 cat > /etc/resolv.conf << EOF
88 # the following nameservers are those which were defined
89 # on the machine where debootstick was run
90 # ------------------------------------------------------
91 EOF
92 grep nameserver /etc/resolv.conf.host >> /etc/resolv.conf
93 rm /etc/resolv.conf.host
94
95 cat >> /etc/resolv.conf << EOF
96
97 # the following nameservers are public ones
98 # ------------------------------------------------------
8099 # cloudflare
81100 nameserver 1.1.1.1
82101 # google