Add IPv6 compatibility to the DNS handling #30
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey Dan
They way I did it with dig is that now it splits the DNS requests into one call that includes all the IPv4 DNS server addresses and binds to the VPN internal IPv4 address and a second call that has all the IPv6 DNS server addresses and binds to the VPN internal IPv6 address.
All of those calls ask for both the A and the AAAA record, because I didn't really see a reason why I shouldn't ask a server I contact over its IPv4 address about the AAAA record or one that I contact over IPv6 about the A record. I figured asking doesn't hurt if we're doing a request anyway.
The command line strings it assembles now look like this for my school's VPN
I thought it over as well as I could and I don't think that I broke anything for the case where the VPN only provides an IPv4 address to the client and informs us about IPv4 DNS server addresses, but I can't test that case since I only have my school VPN, so I'll leave that part to you, Dan.
For my school it seems to work just fine. I see IPv4 and IPv6 routes in the hostfile and if I ping and traceroute an internal host the IPv6 address gets used too.
Indeed everything keeps working even if I purposely filter out the IPv4 DNS server addresses, so that it's forced to only use dig with the IPv6 DNS server address.
Best
--Joel