Схема: Proxmox ve => виртуалка (Ubuntu Server 22.04) => docker
root@gitlab-runner:/home/gitlab-runner-user# docker run --rm -it --name network-test alpine ping gitlab.com
ping: bad address 'gitlab.com'
root@gitlab-runner:/home/gitlab-runner-user# docker run --rm -it --name network-test alpine nslookup gitlab.com
Server: 10.29.4.1
Address: 10.29.4.1:53
Non-authoritative answer:
Name: gitlab.com
Address: 10.30.0.13
** server can't find gitlab.com: REFUSED
root@gitlab-runner:/home/gitlab-runner-user# nslookup gitlab.com
Server: 10.29.4.1
Address: 10.29.4.1#53
Non-authoritative answer:
Name: gitlab.com
Address: 10.30.0.13
** server can't find gitlab.com: REFUSED
root@gitlab-runner:/home/gitlab-runner-user# ping gitlab.com
PING gitlab.com (10.30.0.13) 56(84) bytes of data.
64 bytes from 10.30.0.13 (10.30.0.13): icmp_seq=1 ttl=54 time=95.8 ms
64 bytes from 10.30.0.13 (10.30.0.13): icmp_seq=2 ttl=54 time=95.8 ms
64 bytes from 10.30.0.13 (10.30.0.13): icmp_seq=3 ttl=54 time=96.4 ms
64 bytes from 10.30.0.13 (10.30.0.13): icmp_seq=4 ttl=54 time=96.3 ms
^C
--- gitlab.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 95.818/96.077/96.367/0.259 ms
По дефолту докер тащит днсы с хоста, я добавил конфиг чтобы можно было менять:
/etc/docker/daemon.json:
{
"dns": ["10.29.4.1"]
}
Так-же если передать в nslookup публичный днс - всё работает, но мне необходим именно этот днс:
root@gitlab-runner:/home/gitlab-runner-user# docker run --rm -it --name network-test alpine nslookup gitlab.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8:53
Non-authoritative answer:
Name: gitlab.com
Address: 172.65.251.78
Non-authoritative answer:
Name: gitlab.com
Address: 2606:4700:90:0:f22e:fbec:5bed:a9b9