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

Forward DNS requests made to the vpn server #424

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rca
Copy link
Contributor

@rca rca commented Oct 8, 2018

I needed this in order to resolve my home network's domain names while connected to the VPN. Having this forwarding rule allowed me to make DNS requests to the VPN server and have a hostname like myhomecomputer.homedomain resolve to the appropriate IP.

When $OVPN_DNS_IPTABLES_FORWARD is declared in /etc/openvpn/ovpn_env.sh (for example, declare -x OVPN_DNS_IPTABLES_FORWARD=192.168.1.1:53), add an iptables rule to forward DNS traffic to the specified host.

Please let me know if this is useful and any additional changes needed to be an acceptable patch.

Thanks!

when $OVPN_DNS_IPTABLES_FORWARD is declared, add an iptables rule to forward DNS traffic to the specified host.
Resolve hostnames and then set the iptables rule.
@kylemanna
Copy link
Owner

Would need a test to do this if the justification is ease of use.

Ultimately this is easy to circumvent these days with things like HTTP over DNS if you're doing it for security reasons.

@rca
Copy link
Contributor Author

rca commented Oct 24, 2020

I'm happy to write a test; can you describe what you're looking the test to validate and point me to a similar existing test.

To clarify, this is not for security reasons.

The motivation for this patch is to be able to resolve private hostnames when connected to the vpn. For example, say you configure your local router to the domain .foo, and you want to be able to access your home NAS at nas.foo. This patch would allow DNS requests to the vpn gateway to be forwarded to the router in order to properly resolve the private .foo domain.

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

Successfully merging this pull request may close these issues.

None yet

2 participants