Skip to content

Include /etc/hosts in chroot jail

Ismo Toijala requested to merge itoijala/gitlab-pages:etc-hosts into master

Our server is behind NAT and cannot reach itself over the externally visible IP. The easiest approach to fix it is to add the domain as 127.0.0.1 in /etc/hosts.

Go will read /etc/hosts if it exists, so including it in the chroot together with /etc/resolv.conf fixes the problem.

As I understand it, /etc/resolv.conf and /etc/hosts is the complete set of files used by the Go DNS resolver.

Edited by Wayne Haber

Merge request reports

Loading