Ubuntu 18, VPN and DNS: curl wont resolve VPN-host, but nslookup and dig can
To answer my own question: I digged a bit deeper and learned a bit about avahi
, nscd
, systemd-resolve
and the magic of nsswitch
. So apparently the problem was this line in my /etc/nsswitch.conf
:
hosts: files mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns myhostname
I missed that readme from update-systemd-resolved
actually recommended changing this line. So i changed it to
hosts: files dns resolve myhostname
Et VoilĂ , now curl can reach the host:
$ getent ahosts pritunl-ui.infra.svc.cluster.local10.15.246.61 STREAM pritunl-ui.infra.svc.cluster.local10.15.246.61 DGRAM 10.15.246.61 RAW
I also tried to just remove the [NOTFOUND=return]
part, and that seems to have the same effect, it also works. Maybe it says something like "if mdns fails, stop here and ignore the rest"..? Which would be a very odd strategy i think.