name resolution issue
so, I decide to open a case here because can't figure out how mailing list works, I hope this is the right section.
I've installed Alpine in a VirtualBox VM on a Windows host because I'm trying to make an Alpine Linux setup for Desktop but currently I'm struggling with showstopper problem.
When i setup a vpn connection on the host I'm not able to use any network service that requires name service resolution (E.G. chrony, ssh, firefox, apk) on the alpine guest
alpine@alpibox ~> ssh host.local.site -vv OpenSSH_8.4p1, OpenSSL 1.1.1j 16 Feb 2021 debug1: Reading configuration data /home/alpine/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug2: resolving "host.local.site" port 22 ssh: Could not resolve hostname host.local.site: Name does not resolve
but if I nslookup to any host the dns respond correctly. Without VPN everything it's ok. I've already tried to create a /etc/nsswitch file and to restart networking service multiple times.
after some high-level debugging, I've notice that nslookup took a very short (60.77 millis) time before exit with "no answer from the server" error.
alpine@alpibox ~> time nslookup host.local.site Server: x.x.x.1 Address: x.x.x.1:53 *** Can't find host.local.site: No answer ________________________________________________________ Executed in 60.77 millis fish external usr time 1.09 millis 492.00 micros 598.00 micros sys time 0.00 millis 0.00 micros 0.00 micros
testing the zone-transfer (port 53/TCP) everything works fine.
apline@alpibox ~> time nslookup www.google.com Server: x.x.x.1 Address: x.x.x.1:53 Non-authoritative answer: Name: www.google.com Address: 220.127.116.11 Non-authoritative answer: Name: www.google.com Address: 2a00:1450:400e:80a::2004 ________________________________________________________ Executed in 66.79 millis fish external usr time 1.38 millis 531.00 micros 849.00 micros sys time 0.10 millis 100.00 micros 0.00 micros
bot when it comes to local name resolution (port 53/UDP) something odd happens
alpine@alpibox ~> time nc -u -z -v x.x.x.1 53 x.x.x.1 (x.x.x.1:53) open ________________________________________________________ Executed in 2.29 secs fish external usr time 869.00 micros 348.00 micros 521.00 micros sys time 66.00 micros 66.00 micros 0.00 micros
as you can see nslookup has a very short timeout (60.77 millis), but the netcat command shows that the server took about 1sec to respond.
I tried to edit /etc/resolv.conf with some options (please see below) but nothing happened. moreover the nslookup doesn't respect the timeout option nor the attempts option written in the file.
alpine@alpibox ~> cat /etc/resolv.conf nameserver x.x.x.1 nameserver x.x.x.2 nameserver x.x.x.3 options timeout:3 options attempts:2
It's not a VPN or VirtualBox issue because I tried the same with other distros everything works as aspected.
any hint to debug and solving this?