<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>In the documentation for the dnsdist webserver at
      <a class="moz-txt-link-rfc2396E" href="https://www.dnsdist.org/guides/webserver.html"><https://www.dnsdist.org/guides/webserver.html></a> it shows in
      several places</p>
    <p><span class="nt"
style="box-sizing: inherit; transition: none !important; color: rgb(63, 110, 198); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">webserver</span><span
      class="p"
style="box-sizing: inherit; transition: none !important; color: rgba(0, 0, 0, 0.54); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:</span><span
style="color: rgb(54, 70, 78); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(245, 245, 245); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
</span><span class="w"
style="box-sizing: inherit; transition: none !important; color: rgb(54, 70, 78); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  </span><span
      class="nt"
style="box-sizing: inherit; transition: none !important; color: rgb(63, 110, 198); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">listen_address</span><span
      class="p"
style="box-sizing: inherit; transition: none !important; color: rgba(0, 0, 0, 0.54); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:</span><span
      class="w"
style="box-sizing: inherit; transition: none !important; color: rgb(54, 70, 78); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> </span><span
      class="s"
style="box-sizing: inherit; transition: none !important; color: rgb(28, 125, 77); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">"127.0.0.1:8083"</span></p>
    <p>but that appears to be wrong; the accepted YAML is</p>
    <p><span class="nt"
style="box-sizing: inherit; transition: none !important; color: rgb(63, 110, 198); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">webserver</span><span
      class="p"
style="box-sizing: inherit; transition: none !important; color: rgba(0, 0, 0, 0.54); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:</span><span
style="color: rgb(54, 70, 78); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; background-color: rgb(245, 245, 245); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
</span><span class="w"
style="box-sizing: inherit; transition: none !important; color: rgb(54, 70, 78); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  </span><span
      class="nt"
style="box-sizing: inherit; transition: none !important; color: rgb(63, 110, 198); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">listen_addresses</span><span
      class="p"
style="box-sizing: inherit; transition: none !important; color: rgba(0, 0, 0, 0.54); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">:</span><span
      class="w"
style="box-sizing: inherit; transition: none !important; color: rgb(54, 70, 78); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> [</span><span
      class="s"
style="box-sizing: inherit; transition: none !important; color: rgb(28, 125, 77); font-family: "Roboto Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: none; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">"127.0.0.1:8083"]</span></p>
    <p>Now, the main issue I have is around getting v4+v6 to work. With
      dnsdist 2.1.2 under Ubuntu 24.04, if I write:</p>
    <p><font face="monospace">webserver:<br>
          listen_addresses:<br>
            - "[::]:8083"<br>
          acl:<br>
            - 127.0.0.1<br>
            - "::1"<br>
          stats_require_authentication: false</font></p>
    <p>then connections on IPv6 work, but connections on IPv4 are
      immediately dropped:</p>
    <p># telnet 127.0.0.1 8083<br>
      Trying 127.0.0.1...<br>
      Connected to 127.0.0.1.<br>
      Escape character is '^]'.<br>
      Connection closed by foreign host.<br>
      #</p>
    <p>But if I try to listen on both v6 and v4 wildcards:</p>
    <p><font face="monospace">webserver:<br>
          listen_addresses:<br>
      </font><font face="monospace">    - "[::]:8083"</font><br>
      <font face="monospace">    - "0.0.0.0:8083"<br>
          acl:<br>
            - 127.0.0.1<br>
            - "::1"<br>
          stats_require_authentication: false</font></p>
    <p>then connections on v6 are refused:</p>
    <p># telnet ::1 8083<br>
      Trying ::1...<br>
      telnet: Unable to connect to remote host: Connection refused</p>
    <p>It seems to be listening on IPv4 only:</p>
    <p># ss -natp | grep :8083<br>
      LISTEN    0      5                 0.0.0.0:8083           
       0.0.0.0:*     users:(("dnsdist",pid=105473,fd=14))<br>
      # </p>
    <p>If I swap the two listen_addresses around it makes no
      difference. It's also same if I bind explicitly to individual IPv4
      addresses:</p>
    <p>webserver:<br>
        listen_addresses:<br>
          - "[::]:8083"<br>
          - "10.12.249.4:8083"<br>
          - "127.0.0.1:8083"</p>
    <p># ss -natp | grep :8083<br>
      LISTEN    0      5          127.0.0.1:8083       0.0.0.0:*   
       users:(("dnsdist",pid=105601,fd=14))<br>
      LISTEN    0      5        10.12.249.4:8083       0.0.0.0:*   
       users:(("dnsdist",pid=105601,fd=15))<br>
      # </p>
    <p>Again, it's listening only on IPv4.</p>
    <p>The only way I can get it to work is to list individually the
      IPv6 addresses to bind on:</p>
    <p>webserver:<br>
        listen_addresses:<br>
          - "[XXXX:XXX:XX:XXXX::4]:8083"<br>
          - "[::1]:8083"<br>
          - "0.0.0.0:8083"</p>
    <p>and now it's OK:</p>
    <p># ss -natp | grep :8083<br>
      LISTEN    0      5                    0.0.0.0:8083     
       0.0.0.0:*     users:(("dnsdist",pid=105732,fd=14))<br>
      LISTEN    0      5                      [::1]:8083         
      [::]:*     users:(("dnsdist",pid=105732,fd=15))<br>
      LISTEN    0      5      [XXXX:XXX:XX:XXXX::4]:8083         
      [::]:*     users:(("dnsdist",pid=105732,fd=16))</p>
    <p>Anyway, I just thought it was worth a mention. It's just a bit
      awkward because when there are multiple servers, it means the
      config files have to be slightly different on each one.</p>
    <p></p>
    <p>I have a vague idea I've seen this behaviour before with pdns
      auth or recursor, but I can't remember what the underlying issue
      was. I found this in docs/upgrading.rst:</p>
    <p><font face="monospace">ixfrdist IPv6 support<br>
        ^^^^^^^^^^^^^^^^^^^^^<br>
        <br>
        ``ixfrdist`` now binds listening sockets with `IPV6_V6ONLY set`,
        which means that ``[::]`` no longer accepts IPv4 connections.<br>
        If you want to listen on both IPv4 and IPv6, you need to add a
        line with ``0.0.0.0`` to the ``listen`` section of your ixfrdist
        configuration.</font><br>
    </p>
    <p>but the proposed workaround of adding both [::] and 0.0.0.0
      doesn't appear to work in practice, at least not in dnsdist.</p>
    <p>Regards,</p>
    <p>Brian.</p>
  </body>
</html>