2

I've seen the "header format" section of rfc 1035, but it only says that the id can be a random value. Now can this random value be a 0 or not, that's what I want to know.

ibrar arshad
  • 223
  • 2
  • 7

1 Answers1

0

RFC1035 makes no restriction on the transaction ID, except that it is 16 bits long, so 0 is perfectly fine. Whatever you send there will be copied to the response.

To further verify this, I have checked the source code of the resolvers below and they all seem to agree that all 16 bits of the ID are yours to take.

  • Unbound: ID is any random value between 0 - 0xffff.
  • ARSoft.Tools.Net: ID is any random value between 0 - 0xffff.
  • Synapse (Delphi networking library): ID is any random value between 0 - 0xffff.
PeterK
  • 3,667
  • 2
  • 17
  • 24
  • I agree with you. That's what I thought. I am using nsupdate tool to send the dns requests and seemingly in some packets, "0" is also received as the request id. I just wanted to make sure that it wasn't some malformed packet that I was receiving. Can you please confirm about nsupdate as well? – ibrar arshad May 08 '15 at 17:26
  • @ibrararshad: I tried to look into bind9 source code -- which should include `nsupdate` -- but there were so many levels of abstraction that I gave up, so I can't give a confirmation for that. The RFC is quite clear, though. Also, even though neither ARSoft.Tools.Net or Synapse is what I would consider a 'reference' source, in my opinion Unbound is as good in this regard as as bind itself. – PeterK May 08 '15 at 17:37