Retrieved from OpenVPN: name server(s) [ 10.10.49.1 ], search domain(s) [ ] and SMB server(s) [ ] and using default domain name [ openvpn ]
WARNING: Ignoring ServerAddresses '10.10.49.1' because ServerAddresses was set manually
Setting search domains to 'openvpn' because running under OS X 10.6 or higher and the search domains were not set manually and 'Prepend domain name to search domains' was not selected
Saved the DNS and SMB configurations so they can be restored
Did not change DNS ServerAddresses setting of '127.0.0.54' (but re-set it)
Changed DNS SearchDomains setting from '' to 'openvpn'
Changed DNS DomainName setting from 'attlocal.net' to 'openvpn'
Did not change SMB NetBIOSName setting of ''
Did not change SMB Workgroup setting of ''
Did not change SMB WINSAddresses setting of ''
DNS servers '127.0.0.54' were set manually
DNS servers '127.0.0.54' will be used for DNS queries when the VPN is active
NOTE: The DNS servers do not include any free public DNS servers known to Tunnelblick. This may cause DNS queries to fail or be intercepted or falsified even if they are directed through the VPN. Specify only known public DNS servers or DNS servers located on the VPN network to avoid such problems.
As you have seen, Tunnelblick will not modify the DNS settings if they were set manually.The easiest way to do what you want is probably to create two scripts to be used by Tunnelblick:
- A "pre-connect.sh" script that sets DNS to use DHCP before connecting to the VPN, and
- A "post-disconnect.sh" script to restore the manual settings after disconnecting from the VPN
<-- snip -->
If you end up doing this (or solve the problem some other way), please post here.
On Monday, June 27, 2016 at 11:46:11 AM UTC-5, jkbull...gmail.com wrote:Unfortunately, I'm not much of a scripter and am stuck on how to re-enable DNSCrypt. Ideally, I'd save the value of the DNS Server(s) before removing them. How can I save this value and have it available to a script that sets the DNS Server(s) with this saved value? I don't know how to persist variable values across script executions. :-(
echo "dnsServers" > "/tmp/my-dnscrypt-servers"
dnsServers="$(cat "/tmp/my-dnscrypt-servers")"
If you end up doing this (or solve the problem some other way), please post here.
/Library/Application Support/DNSCrypt/control/dnscrypt/switch-to-dnscrypt.sh
/Library/Application Support/DNSCrypt/control/dnscrypt/ switch-to-dhcp.sh