When using a self-hosted git and DNS, hocus fails on the prebuild stage for such a repo since it cannot resolve the local name with the hardcoded 8.8.8.8 DNS server.
In my setup, I host a DNS server locally in the network and provide local domain names that get resolved through it. The DNS server IP is given along with the DHCP lease so the host system knows which resolver to use, but Hocus does not inherit this and fails to resolve the name of the local git server.
Steps to reproduce
Install Hocus
Set up a git server in a local network as well as a DNS server with records pointing to that git server
Add a repository to Hocus
Result
The prebuild status for branches stays pending perpetually as it fails to fetch the project since it cannot resolve the local git server with 8.8.8.8.
What should happen
Hocus should be able to resolve local DNS names and pull the repo.
Possible fixes
This issue could be fixed by providing the ability to configure DNS servers used internally instead of hardcoding 8.8.8.8, or by setting up a DNS forwarder that the VMs could use internally that would then forward the requests to the DNS used by the host system.
Environment
Hocus version (commit hash): a998d71c4b359ae80a47a42d95886d0296e601f8
Hi @szymex73!
Thank you for reporting this bug :) We will add a DNS proxy to the Hocus Agent so the VM's will be able to use the DNS resolver inside the agent container.
🐛 Bug description
When using a self-hosted git and DNS, hocus fails on the prebuild stage for such a repo since it cannot resolve the local name with the hardcoded 8.8.8.8 DNS server.
In my setup, I host a DNS server locally in the network and provide local domain names that get resolved through it. The DNS server IP is given along with the DHCP lease so the host system knows which resolver to use, but Hocus does not inherit this and fails to resolve the name of the local git server.
Steps to reproduce
Result
The prebuild status for branches stays pending perpetually as it fails to fetch the project since it cannot resolve the local git server with 8.8.8.8.
What should happen
Hocus should be able to resolve local DNS names and pull the repo.
Possible fixes
This issue could be fixed by providing the ability to configure DNS servers used internally instead of hardcoding 8.8.8.8, or by setting up a DNS forwarder that the VMs could use internally that would then forward the requests to the DNS used by the host system.
Environment