Is a DNS packet with only a header (no questions or resources) valid?












1















Looking at RFC 1035 I am trying to determine what the proper response is for a packet that contains nothing but a DNS header, where all the "counts" are zero:



id         short     X
qdcount short 0
ancount short 0
nscount short 0
arcount short 0
<EOF>


Should this packet have any response? Should it be considered an error?










share|improve this question



























    1















    Looking at RFC 1035 I am trying to determine what the proper response is for a packet that contains nothing but a DNS header, where all the "counts" are zero:



    id         short     X
    qdcount short 0
    ancount short 0
    nscount short 0
    arcount short 0
    <EOF>


    Should this packet have any response? Should it be considered an error?










    share|improve this question

























      1












      1








      1


      0






      Looking at RFC 1035 I am trying to determine what the proper response is for a packet that contains nothing but a DNS header, where all the "counts" are zero:



      id         short     X
      qdcount short 0
      ancount short 0
      nscount short 0
      arcount short 0
      <EOF>


      Should this packet have any response? Should it be considered an error?










      share|improve this question














      Looking at RFC 1035 I am trying to determine what the proper response is for a packet that contains nothing but a DNS header, where all the "counts" are zero:



      id         short     X
      qdcount short 0
      ancount short 0
      nscount short 0
      arcount short 0
      <EOF>


      Should this packet have any response? Should it be considered an error?







      dns packet network-protocols






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 30 at 16:32









      Kristopher IvesKristopher Ives

      66111




      66111






















          2 Answers
          2






          active

          oldest

          votes


















          3





          +50









          Any DNS query where qdcount is not equal to 1 should be rejected by the DNS server.



          The returned error will most likely be "Format Error" (FORMERR, rcode=1),
          which is only logical, since a DNS query for nothing at all must be considered
          as malformed.



          Finding official sources for this is pretty hard.
          I did find for the NSD server a
          bug report
          where it was tested and remarked : "QDCOUNT=0 makes it FORMERR".



          For the BIND server, StackOverflow post
          What does QD stand for in DNS RFC1035
          says this about QDCOUNT:




          note that this field is useless now, because BIND has always rejected QDCOUNT != 1.







          share|improve this answer

































            0














            Potentially depends on the opcode specified in the header (there are several – query, notify, update, etc.) For regular queries RFC 1034 says:




            A standard query specifies a target domain name (QNAME), query type (QTYPE), and query class (QCLASS) and asks for RRs which match.




            I would interpret the use of the singular "target" etc. as a query always having exactly one record in the question section; anything else should return FORMERR.



            There are variations (e.g. the obsolete IQUERY uses queries with at least one record in answer section, but empty question section), but I couldn't find any opcodes which would allow all sections to be empty.






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400157%2fis-a-dns-packet-with-only-a-header-no-questions-or-resources-valid%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3





              +50









              Any DNS query where qdcount is not equal to 1 should be rejected by the DNS server.



              The returned error will most likely be "Format Error" (FORMERR, rcode=1),
              which is only logical, since a DNS query for nothing at all must be considered
              as malformed.



              Finding official sources for this is pretty hard.
              I did find for the NSD server a
              bug report
              where it was tested and remarked : "QDCOUNT=0 makes it FORMERR".



              For the BIND server, StackOverflow post
              What does QD stand for in DNS RFC1035
              says this about QDCOUNT:




              note that this field is useless now, because BIND has always rejected QDCOUNT != 1.







              share|improve this answer






























                3





                +50









                Any DNS query where qdcount is not equal to 1 should be rejected by the DNS server.



                The returned error will most likely be "Format Error" (FORMERR, rcode=1),
                which is only logical, since a DNS query for nothing at all must be considered
                as malformed.



                Finding official sources for this is pretty hard.
                I did find for the NSD server a
                bug report
                where it was tested and remarked : "QDCOUNT=0 makes it FORMERR".



                For the BIND server, StackOverflow post
                What does QD stand for in DNS RFC1035
                says this about QDCOUNT:




                note that this field is useless now, because BIND has always rejected QDCOUNT != 1.







                share|improve this answer




























                  3





                  +50







                  3





                  +50



                  3




                  +50





                  Any DNS query where qdcount is not equal to 1 should be rejected by the DNS server.



                  The returned error will most likely be "Format Error" (FORMERR, rcode=1),
                  which is only logical, since a DNS query for nothing at all must be considered
                  as malformed.



                  Finding official sources for this is pretty hard.
                  I did find for the NSD server a
                  bug report
                  where it was tested and remarked : "QDCOUNT=0 makes it FORMERR".



                  For the BIND server, StackOverflow post
                  What does QD stand for in DNS RFC1035
                  says this about QDCOUNT:




                  note that this field is useless now, because BIND has always rejected QDCOUNT != 1.







                  share|improve this answer















                  Any DNS query where qdcount is not equal to 1 should be rejected by the DNS server.



                  The returned error will most likely be "Format Error" (FORMERR, rcode=1),
                  which is only logical, since a DNS query for nothing at all must be considered
                  as malformed.



                  Finding official sources for this is pretty hard.
                  I did find for the NSD server a
                  bug report
                  where it was tested and remarked : "QDCOUNT=0 makes it FORMERR".



                  For the BIND server, StackOverflow post
                  What does QD stand for in DNS RFC1035
                  says this about QDCOUNT:




                  note that this field is useless now, because BIND has always rejected QDCOUNT != 1.








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 8 at 8:12

























                  answered Mar 4 at 21:38









                  harrymcharrymc

                  263k14271580




                  263k14271580

























                      0














                      Potentially depends on the opcode specified in the header (there are several – query, notify, update, etc.) For regular queries RFC 1034 says:




                      A standard query specifies a target domain name (QNAME), query type (QTYPE), and query class (QCLASS) and asks for RRs which match.




                      I would interpret the use of the singular "target" etc. as a query always having exactly one record in the question section; anything else should return FORMERR.



                      There are variations (e.g. the obsolete IQUERY uses queries with at least one record in answer section, but empty question section), but I couldn't find any opcodes which would allow all sections to be empty.






                      share|improve this answer






























                        0














                        Potentially depends on the opcode specified in the header (there are several – query, notify, update, etc.) For regular queries RFC 1034 says:




                        A standard query specifies a target domain name (QNAME), query type (QTYPE), and query class (QCLASS) and asks for RRs which match.




                        I would interpret the use of the singular "target" etc. as a query always having exactly one record in the question section; anything else should return FORMERR.



                        There are variations (e.g. the obsolete IQUERY uses queries with at least one record in answer section, but empty question section), but I couldn't find any opcodes which would allow all sections to be empty.






                        share|improve this answer




























                          0












                          0








                          0







                          Potentially depends on the opcode specified in the header (there are several – query, notify, update, etc.) For regular queries RFC 1034 says:




                          A standard query specifies a target domain name (QNAME), query type (QTYPE), and query class (QCLASS) and asks for RRs which match.




                          I would interpret the use of the singular "target" etc. as a query always having exactly one record in the question section; anything else should return FORMERR.



                          There are variations (e.g. the obsolete IQUERY uses queries with at least one record in answer section, but empty question section), but I couldn't find any opcodes which would allow all sections to be empty.






                          share|improve this answer















                          Potentially depends on the opcode specified in the header (there are several – query, notify, update, etc.) For regular queries RFC 1034 says:




                          A standard query specifies a target domain name (QNAME), query type (QTYPE), and query class (QCLASS) and asks for RRs which match.




                          I would interpret the use of the singular "target" etc. as a query always having exactly one record in the question section; anything else should return FORMERR.



                          There are variations (e.g. the obsolete IQUERY uses queries with at least one record in answer section, but empty question section), but I couldn't find any opcodes which would allow all sections to be empty.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          answered Mar 4 at 21:38


























                          community wiki





                          grawity































                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400157%2fis-a-dns-packet-with-only-a-header-no-questions-or-resources-valid%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Сан-Квентин

                              8-я гвардейская общевойсковая армия

                              Алькесар