Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Inherit nameserver(s) unless is localhost, in which case use

  • Loading branch information...
commit 8461f4758f9899f7aa58a13b22be7afabf19ee55 1 parent f7de02e
Matthew Boedicker & Nate Clark authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 warden/root/linux/skeleton/
16 warden/root/linux/skeleton/
@@ -81,8 +81,20 @@ cat > mnt/etc/hosts <<-EOS
$network_container_ip $id
-# Inherit nameserver(s)
-cp /etc/resolv.conf mnt/etc/
+# By default, inherit the nameserver from the host container.
+# Exception: When the host's nameserver is set to localhost (, it is
+# assumed to be running its own DNS server and listening on all interfaces.
+# In this case, the warden container must use the network_host_ip address
+# as the nameserver.
+if [[ "$(cat /etc/resolv.conf)" == "nameserver" ]]
+ cat > mnt/etc/resolv.conf <<-EOS
+nameserver $network_host_ip
+ cp /etc/resolv.conf mnt/etc/
# Add vcap user if not already present
$(which chroot) mnt env -i /bin/bash <<-EOS
Please sign in to comment.
Something went wrong with that request. Please try again.