mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 10:05:48 +03:00
[GH-ISSUE #233] Failure to use local DNS server #216
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pindab0ter on GitHub (Feb 28, 2021).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/233
Checklist
Describe the issue
When setting
VPN_DNS_SRV1=192.168.0.201(which is the address of my local DNS server) requests to my *.local-domains fail to be properly resolved.To Reproduce
Steps to reproduce the behavior:
vpn.env:vpnclient.mobileconfigfile*.local-domainsExpected behavior
I expect the domain to be resolved by the local DNS server.
Logs
Enable logs, check VPN status, and add error logs to help explain the problem, if applicable.
Server (please complete the following information)
Client (please complete the following information)
Additional context
Does the fact that the DNS server assigns to a different subnet (
192.168.42.###) have anything to do with this? The fact that I'm able to ping the DNS server directly from within the container makes me think no.@hwdsl2 commented on GitHub (Feb 28, 2021):
@pindab0ter Hello! This is probably unrelated to the different subnet you mentioned. I think that your use case can work, by adding the
modecfgdomainsoption to/etc/ipsec.d/ikev2.conf. Reference: [1][2]. Try:After that, re-connect your VPN client. Let us know if this works for your use case.
[1] https://libreswan.org/man/ipsec.conf.5.html
[2] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/securing_networks/configuring-a-vpn-with-ipsec_securing-networks
@pindab0ter commented on GitHub (Mar 1, 2021):
Thank you for your fast follow-up. The suggested edit indeed works for my use case. Can this be made an optional setting or at least be added to the documentation? I'm also curious; does "local" in
modecfgdomains=localrefer to locally resolving domains or resolving.localdomains?@hwdsl2 commented on GitHub (Mar 2, 2021):
@pindab0ter Thanks for confirming. I think
modecfgdomains=localrefers to resolving.localdomains. While usingmodecfgdomainsmakes sure that the specified internal domains must be resolved using the custom DNS server(s), it might cause all other DNS traffic (all domains other than.localin your use case) to go through the VPN client device's pre-configured DNS servers instead. See [1]. Quote:For reference, the IETF internet draft related to this is [2].
Normally, I think client devices should use the custom DNS server(s) you specified in
vpn.envfor all DNS queries, ifmodecfgdomainsis not specified. I'm not sure why.localdoesn't work without this option in your use case. Perhaps it is related to Apple devices' special handling of.localdomains (see [3])? If you have additional thoughts on this, feel free to reply.As discussed above, the usage of this option is not entirely clear, so I'll probably not add it to the documentation at this time.
[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/road_warrior_application_using_libreswan_and_xauth_with_x.509
[2] https://tools.ietf.org/html/draft-ietf-ipsecme-split-dns-03
[3] https://serverfault.com/questions/47087/using-local-for-internal-websites
@pindab0ter commented on GitHub (Mar 6, 2021):
I have changed my local domain from “.local” to something arbitrary and without any extra configuration in the VPN’s config the changes were picked up, ruling out
modecfgdomains=localreferring to the literal TLD.I then removed that config line you suggested I add and ran
service IPSec restartbefore reconnecting to the VPN. I was able to connect with the services ending on the new arbitrary TLD. So it seems like this is related to Apple devices’ handling of.localas you expected.