Observed On:
Mac OS X Yosemite and El Capitan
Viscosity 1.6 and 1.6.1
Symptoms:
When connecting to a VPN using the correct credentials, DNS servers are set correctly. In case the login fails (e.g. typo in password) the login dialog is shown again (pre-filled user name field).
After entering the correct credentials, DNS settings are applied in the wrong order and the primary resolver is not marked as reachable. This results in all DNS lookups hanging indefinitely, with the exception of libresolv based tools like host, dig, and nslookup, which use the wrong name servers, but at least work.
When clicking “Cancel” instead and re-connecting to the VPN from scratch, DNS configuration works as expected. This happens with both Automatic and Full DNS modes.
How To Repeat:
- Connect to the VPN
- Check DNS configuration using scutil --dns.
- Try host sparklabs.com command (works)
- Try dscacheutil -q host -a name sparklabs.com (works)
- Log out.
- Attempt to connect using the correct username and an invalid password
- Wait for the login dialog to reappear (username is already set)
- Enter the correct password and connect
- Check DNS configuration using scutil --dns, compare to previous output
- Try host sparklabs.com command (works ok if the resolver is reachable)
- Try dscacheutil -q host -a name sparklabs.com (hangs)
Samples:
DNS configuration on a normal, working connection (authenticated successfully on first attempt):
$ netstat -rn | grep "/1"
0/1 172.30.2.1 UGSc 0 0 utun0
128.0/1 172.30.2.1 UGSc 1 0 utun0
$ scutil --dns
...
resolver #1
search domain[0] : example.org
nameserver[0] : 172.30.1.2
nameserver[1] : 172.30.1.1
if_index : 12 (utun0)
flags : Scoped, Request A records
reach : Reachable
resolver #2
nameserver[0] : 8.8.8.8
nameserver[1] : 8.8.4.4
if_index : 4 (en0)
flags : Scoped, Request A records
reach : Reachable
$ cat /etc/resolv.conf |grep -v "#"
search example.org
nameserver 172.30.1.2
nameserver 172.30.1.1
$ host sparklabs.com
sparklabs.com has address 66.185.22.121
sparklabs.com mail is handled by 10 silicon.sparklabs.com.
$ dscacheutil -q host -a name www.sparklabs.com
name: www.sparklabs.com
ip_address: 104.25.84.32
ip_address: 104.25.85.32
DNS configuration on a broken connection (authenticated successfully on second attempt, like described above):
$ netstat -rn | grep "/1"
0/1 172.30.2.1 UGSc 0 0 utun0
128.0/1 172.30.2.1 UGSc 1 0 utun0
$ scutil --dns
...
resolver #1
nameserver[0] : 8.8.8.8
nameserver[1] : 8.8.4.4
if_index : 4 (en0)
flags : Scoped, Request A records
resolver #2
search domain[0] : example.org
nameserver[0] : 172.30.1.2
nameserver[1] : 172.30.1.1
if_index : 12 (utun0)
flags : Scoped, Request A records
reach : Reachable
$ cat /etc/resolv.conf |grep -v "#"
nameserver 8.8.8.8
nameserver 8.8.4.4
$ host sparklabs.com
sparklabs.com has address 66.185.22.121
sparklabs.com mail is handled by 10 silicon.sparklabs.com.
$ dscacheutil -q host -a name www.sparklabs.com
***hangs***
Cheers,
Michael