mafintosh / dns-packet

An abstract-encoding compliant module for encoding / decoding DNS packets
MIT License
201 stars 69 forks source link

Add NS & SOA #6

Closed damnboy closed 6 years ago

damnboy commented 7 years ago

parse ns & soa response :)

silverwind commented 7 years ago

NS looking good, but the SOA parsing seems off:

;; ANSWER SECTION:
google.com.     20 IN SOA ns1.google.com. dns-admin.google.com. 165067107 900 900 1800 60
{ name: 'google.com',
       type: 'SOA',
       class: 1,
       ttl: 59,
       flush: false,
       data: { primary: 'ns1.google.com', mail: 'google.com' } }

mail should be dns-admin@google.com, and the other numerical values are also missing. I'd suggest this output for google.com:

{
  primary: 'ns1.google.com',
  mail: 'dns-admin@google.com',
  serial: 165067107,
  refresh: 900,
  retry: 900,
  expire: 1800,
  ttl: 60
}
silverwind commented 6 years ago

This has been implemented in https://github.com/mafintosh/dns-packet/pull/14 now.