coredns icon indicating copy to clipboard operation
coredns copied to clipboard

Bind link-local addresses for interfaces using scope

Open riedel opened this issue 2 years ago • 2 comments

What would you like to be added:

#4531 removed linking link-local addresses altogether.

However, I am not sure how this is any wanted behavior: it was rather done to work around a bug.

IMHO this just a misunderstanding, how binding link-local IPv6 addresses work. Typically you just need to provide a scope, which is actually given by the interface. This means that the semantics would be fully defined when using e.g. bind eth0

See eg. https://stackoverflow.com/questions/2460841/how-to-bind-a-link-local-address-to-an-ipv6-socket.

The problem is that this would require some more rewriting as the net.ParseIP does not support the scope (see e.g. https://github.com/ooni/probe/issues/2036 here) . So I was just wondering before submitting a pull request if for whatever reason the link-local exception is wanted behaviour.

Why is this needed:

To me this is a real problem at the moment, when trying to use CoreDNS for local DNS rewriting. The problem with using a global address is that in my dynamic DNS setting the prefix may change, so I cannot hardcode the DNS Server for my network.

Feedback and workarounds welcome

riedel avatar Mar 10 '24 12:03 riedel

From reading https://github.com/coredns/coredns/pull/4531, it seems the change was done because it was easier to disable than fix. If you'd like to propose a fix you may do so.

chrisohaver avatar Mar 11 '24 13:03 chrisohaver

This is my PR in go but I tried to address it and it seemed quite straight forward actually: #6547

riedel avatar Mar 11 '24 22:03 riedel