[GH-ISSUE #292] Resolving .local Hostnames #269

Closed
opened 2026-03-02 08:00:55 +03:00 by kerem · 6 comments
Owner

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!

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!
kerem closed this issue 2026-03-02 08:00:55 +03:00
Author
Owner

@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 .local hostnames? If they can, it could be an issue with Apple devices' special treatment of the .local domain, see #233. If they cannot, try switching to use DNS server(s) that can resolve your .local hostnames.

Let us know if this works for you.

<!-- gh-comment-id:1128268023 --> @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 `.local` hostnames? If they can, it could be an issue with Apple devices' special treatment of the `.local` domain, see #233. If they cannot, try switching to use DNS server(s) that can resolve your `.local` hostnames. Let us know if this works for you.
Author
Owner

@squishycat92 commented on GitHub (May 17, 2022):

Sorry, I'm not particularly knowledgeable about .local domains - 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?

<!-- gh-comment-id:1128293207 --> @squishycat92 commented on GitHub (May 17, 2022): Sorry, I'm not particularly knowledgeable about `.local` domains - 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?
Author
Owner

@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 env file, CloudFlare in your case). Since CloudFlare does not know your .local domain, it will return "not found" for those DNS queries. That could be the reason that those .local domains are not resolving.

To fix, you'll need to switch to use a custom DNS server that is aware of your .local hostnames (i.e. can resolve them).

<!-- gh-comment-id:1128352386 --> @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 `env` file, CloudFlare in your case). Since CloudFlare does not know your `.local` domain, it will return "not found" for those DNS queries. That could be the reason that those `.local` domains are not resolving. To fix, you'll need to switch to use a custom DNS server that is aware of your `.local` hostnames (i.e. can resolve them).
Author
Owner

@squishycat92 commented on GitHub (May 17, 2022):

I see, thank you so much for clarifying! In this case, I would assume that .local hostnames are being resolved by the router/gateway. Would I just specify the DNS server to be my router's local IP?

<!-- gh-comment-id:1128431847 --> @squishycat92 commented on GitHub (May 17, 2022): I see, thank you so much for clarifying! In this case, I would assume that `.local` hostnames are being resolved by the router/gateway. Would I just specify the DNS server to be my router's local IP?
Author
Owner

@hwdsl2 commented on GitHub (May 17, 2022):

@squishycat92 You're welcome. Yes, try setting the new DNS server for the VPN in your env file. 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.conf inside the Docker container to change the DNS servers.

<!-- gh-comment-id:1128467994 --> @hwdsl2 commented on GitHub (May 17, 2022): @squishycat92 You're welcome. Yes, try setting the new DNS server for the VPN in your `env` file. 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.conf` inside the Docker container to change the DNS servers.
Author
Owner

@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 .local resolution isn't stable. Thanks for your help though!

<!-- gh-comment-id:1129449370 --> @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 `.local` resolution isn't stable. Thanks for your help though!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#269
No description provided.