mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 10:05:48 +03:00
[GH-ISSUE #292] Resolving .local Hostnames #269
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 @squishycat92 on GitHub (May 16, 2022).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/292
Hello,
I currently have a file server running on Samba on my home network (same VM that is running this container). However, I cannot connect using its hostname (
hostname.local), but using the direct IP works just fine. I did some research and it seems like this issue has something to do with a faulty DNS server. Any ideas on how I can get the hostname to resolve? I should mention that I do have custom DNS servers (CloudFlare) set in my environment settings.Thanks in advance!
@hwdsl2 commented on GitHub (May 17, 2022):
@squishycat92 Hello! Please review this related issue #233 to see if it is helpful for your use case. Can your custom DNS servers (CloudFlare) resolve your
.localhostnames? If they can, it could be an issue with Apple devices' special treatment of the.localdomain, see #233. If they cannot, try switching to use DNS server(s) that can resolve your.localhostnames.Let us know if this works for you.
@squishycat92 commented on GitHub (May 17, 2022):
Sorry, I'm not particularly knowledgeable about
.localdomains - what would it mean for CloudFlare to be able to resolve it? I have profiles on my devices that explicitly state to use CloudFlare DoH, but when not connected to a VPN all local hostnames resolve correctly. Would I need to set the DNS server to the gateway IP instead?@hwdsl2 commented on GitHub (May 17, 2022):
@squishycat92 If I understand it correctly, you are trying to reach the file server from a VPN client that is connected to the IPsec VPN. The IPsec VPN server is running in a container on the same VM.
When connected to the VPN, all DNS queries would go through the DNS server in the IPsec VPN configuration (i.e. what you specified in the
envfile, CloudFlare in your case). Since CloudFlare does not know your.localdomain, it will return "not found" for those DNS queries. That could be the reason that those.localdomains are not resolving.To fix, you'll need to switch to use a custom DNS server that is aware of your
.localhostnames (i.e. can resolve them).@squishycat92 commented on GitHub (May 17, 2022):
I see, thank you so much for clarifying! In this case, I would assume that
.localhostnames are being resolved by the router/gateway. Would I just specify the DNS server to be my router's local IP?@hwdsl2 commented on GitHub (May 17, 2022):
@squishycat92 You're welcome. Yes, try setting the new DNS server for the VPN in your
envfile. You may need to re-create the Docker container for this change to take effect. For IKEv2 mode, you may need to manually edit/etc/ipsec.d/ikev2.confinside the Docker container to change the DNS servers.@squishycat92 commented on GitHub (May 18, 2022):
I just got around to trying it, but unfortunately it seems that there is some sort of issue with the DNS server on my router; after a bit of experimentation it seems that
.localresolution isn't stable. Thanks for your help though!