• Tobias Schmidt's avatar
    Fix truncation of messages longer than permitted by the client (#1417) · 697e2b4b
    Tobias Schmidt authored
    * Fix truncation of messages longer than permitted by the client
    
    CoreDNS currently doesn't respect the maximum response size advertised
    by the client and returns the full answer on a message with the TC bit
    set. This breaks client implementations which rely on DNS servers
    respecting the advertised size limit, for example the Ruby stdlib
    client. It also has negative network performance implications, as large
    messages will be split up into multiple UDP packets, even though the
    client will discard the truncated response anyway.
    
    While RFC 2181 permits the response of partial RRSets, finding the
    correct number of records fitting into the advertised response size is
    non-trivial. As clients should ignore truncated messages, this change
    simply removes the full RRSet on truncated messages.
    
    * Remove incorrect etcd test assertion
    
    If a client requests a TXT record larger than its advertised buffer
    size, a DNS server should _not_ respond with the answer, but truncate
    the message and set the TC bit, so that the client can retry using TCP.
    697e2b4b
request.go 6.92 KB