Open jordan-ivpn opened 3 years ago
Linked ticket: [Arch Linux] Improved handling of DNS search domains
(macOS) Now, the system-defined DNS search domains are preserved when the VPN is connected
@jordan-ivpn Can you confirm that the solution below is accurate? (see below)
Preconditions: The OS has a preconfigured DNS search domain(-s) (e.g., "home.lan").
Previous behavior: When the VPN was connected, and the user tried to load "NAS.home.lan" using the hostname "NAS", it failed because no search domains were defined during the VPN connection.
New implementation: When the VPN is connected, the original DNS search domains defined in the system are also used for the VPN connection. When the user tries to load "NAS.home.lan" using the hostname "NAS", the "NAS.home.lan" DNS requests are sent to the configured DNS server.
@stenya
Can you confirm that the solution below is accurate? (see below)
I think so. As mentioned in the Arch ticket (https://github.com/ivpn/desktop-app/issues/267), it might be best to only allow access to the local DNS search domain when the Allow LAN traffic
/Allow Multicast
options are enabled. If these LAN options are not enabled, the app's firewall will block the "*.home.lan" requests, though there may or may not be a time-out involved as the local resolver tries to find the local DNS search domain.
Also, there must be a consideration for allowing the local resolution of "*.home.lan" hostnames only and not for any Internet hosts via the local LAN DNS server, otherwise, this is likely a DNS leak.
The IVPN firewall blocks IP addresses, not "search domains". The IVPN app can either preserve search domains or not use this configuration parameter for a VPN connection.
However:
So, accessing internal resources using DNS search domains depends on two parameters: "Allow LAN traffic" and "Custom DNS".
Additionally, "search domains" may be related not only to local networking (for example, having "google.com" in search domains will allow making DNS requests to "mail.google.com" by simply entering "mail"). Thus, I think it is not correct to allow "search domains" only when "Allow LAN traffic" is enabled.
Also, there must be a consideration for allowing the local resolution of "*.home.lan" hostnames only and not for any Internet hosts via the local LAN DNS server, otherwise, this is likely a DNS leak.
What kind of leak do you mean? Do you mean that local DNS requests may be forwarded outside of the internal network?
This functionality change will affect all users. Since we do not have a final understanding of how it should work and not many users require it, I am going to postpone this ticket (although I have already done some implementation). Let's keep track of customer requests and revisit this later.
What kind of leak do you mean? Do you mean that local DNS requests may be forwarded outside of the internal network?
Resolve github.com
via the VPN server DNS and resolve NAS.home.lan
via the local DNS. If github.com
is resolved by the local DNS, this might be a leak or it might not if making use of the local search domain and the local DNS is important or required.
Bug report
Describe your environment
Describe the problem
On macOS, [there is] an issue when I have Custom DNS configured to use my local DNS server IP. Even when that is configured, it still uses the IVPN resolver, which means it isn't using the DNS search domains configured with my local DNS.
As a result, I'm unable to connect to a network share using a hostname such as smb://NAS.local.lan
Steps to reproduce:
scutil --dns
to check the search domainObserved Results:
Expected Results:
Use the resolver and search domains specified by the IP address when using the Custom DNS option. This works as expected on a different VPN provider (Private Internet Access)
Relevant Code:
n/a