Fix ipv6 support for DNS servers#695
Conversation
rithvikvibhu
left a comment
There was a problem hiding this comment.
- Rebased on master locally to test, IPv6 binds without issues.
- Listening ns and rs on both
::1and a specific ipv6 address (used Tailscale, dns queried from another device) works. - Was curious so looked at Wireshark and ipv4-ns-ipv6-rs and vice versa chosen properly by rs.
- IPv4 behaviour same as before.
But it still needs rebase for tests to pass I think. (And ofc dropping the temp commit)
Once this is merged, I'll try to add binding to multiple addresses/interfaces so nodes can listen on 4 and 6 - discussed on telegram or discord, idr.
|
I think this PR only enables IPv6, not use it by default when available. Saw the reverted localhost change, this shouldn't be a breaking change since it still defaults to IPv4 127.0.0.1. |
|
Ok I looked through this all again, here's my current understanding: First of all - the ipv6 setting for unbound ( Next, bns: the default so solution-wise: there is this test in bns which checks for ipv6 access in really the only possible way: try it. But I think relying on a hard-coded external IP address, even a icann dns root server, is sorta problematic. In discussions, Nodar suggested that we trust the user. Meaning, if the user sets |
Requires chjj/bns#33
Inspired by #685 I went looking for other problems with
127.0.0.1and tried configuring hsd's DNS servers to listen on ipv6 addresses::1. There were several problems with this that need to be addressed in both bns (see above PR) as well as hsd.The misbehavior can be observed on master branch:
hsd --rs-host=::1dig @::1 ...Other combinations will also break such as
hsd --ns-host=::1and thendig @127.0.0.1 ...because the recursive resolver (unbound) thinks ipv6 is false and will just returnSERVFAILeven though the root name server is happily listening on::1REVIEWERS: be sure to
rm -rf node_modules && npm ibecause this PR pulls in the bns PR