Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom DNS for different client #1676

Closed
machsix opened this issue Dec 29, 2024 · 2 comments
Closed

Custom DNS for different client #1676

machsix opened this issue Dec 29, 2024 · 2 comments

Comments

@machsix
Copy link

machsix commented Dec 29, 2024

I have a wireguard network at 10.10.1.0/24 and ethernet at 10.88.111.0/24. Is there any way to custom the DNS response based on client IP? So that when I visit nas.lan from 10.10.1.2, the DNS response will be 10.10.1.100. When I visit nas.lan from 10.88.111.2, the DNS response will be 10.88.111.100. This will avoid machine in 10.88.111.0/24 forward the HTTP request via Wireguard relay server.

@machsix
Copy link
Author

machsix commented Dec 29, 2024

CoreDNS has a similar function like this one https://github.com/coredns/coredns/tree/master/plugin/view

@TheoTechnicguy
Copy link
Contributor

Hi there,

I don't think blocky has the exact feature you are looking for. However, I can suggest the following.

  1. Include both IPs in the response, with the LAN address first. Most clients will prefer that address and revert to using the second one if the first is not resolvable.
  2. Use two instances, one for every network.
  3. Configure the network routes on your network so that the same LAN IP is accessible from the VPN.
  4. Ignore the issue. In my experience, the overhead added by the VPN tunnel is negligible.

@machsix machsix closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants