Where Gitlab Runner resolve DNS?

Hello,

I install gitlab runner into google cloud network.
The gitlab instance is installed into private network, so there are a public ip but you need VPN connection to reach the destination. (Ex : 11.22.33.44 to gitlab.company.example)

So i have installed a VPN. and i have force into /etc/hosts the private network with the domain name
(Ex : 192.168.128.3 gitlab.company.example)
This local range pass to VPN and reach the gitlab instance

Here ping exemple from gitlab-runner instance
# ping gitlab.company.example
PING gitlab.company.example (192.168.128.3): 56 data bytes
64 bytes from 192.168.128.3: seq=0 ttl=63 time=16.145 ms
64 bytes from 192.168.128.3: seq=1 ttl=63 time=12.602 ms
64 bytes from 192.168.128.3: seq=2 ttl=63 time=11.998 ms
64 bytes from 192.168.128.3: seq=3 ttl=63 time=14.953 ms

But i don’t know how. gitlab runner try the public IP:
2019-06-04T12:56:48.763387399Z WARNING: Checking for jobs... failed runner=bQHCpMZs status=couldn't execute POST against https://gitlab.company.example/api/v4/jobs/request: Post https://gitlab.company.example/api/v4/jobs/request: dial tcp 11.22.33.44:443: i/o timeout

The gitlab runner is a docker container and the entrypoint finish by :

ping -c 5 gitlab.company.example
gitlab-runner "$@"

And i see into logs the ping before gitlab-runner lauch go to 192.168.128.3
So, How Gitlab Runner DNS works ?

PS: into my configuration toml i have add clone_url = “http://192.168.128.3” without change. it try always gitlab.company.example. Bug into gitlab-runner ?

Thanks for your help

I have resolve my problem :


Gitlab-Runner use DNS from Go

Go use the file /etc/nsswitch.conf to know where resolve dns query