title: Dns protocol header
body: <p>I want to encode DNS protocol header using C and create a UDP datagram.
  Lets say I have a query www.google.com.</p>
  
  <p>Can anyone suggest how to go about it?</p>
  
  <p>You can find the header format here - 
  <a href="http://www.nersc.gov/~scottc/software/snort/dns_head.html" rel="nofollow noreferrer">http://www.nersc.gov/~scottc/software/snort/dns_head.html</a></p>