Some notes that may be useful when changing the script.
QUERY from macOS
{ id: 0,
type: 'query',
flags: 0,
questions:
[ { name: 'myhost.local', type: 'A', class: 1 },
{ name: 'myhost.local', type: 'AAAA', class: 1 } ],
answers: [],
authorities: [],
additionals: [] }
RESPONSE from macOS
{ id: 0,
type: 'response',
flags: 1024,
questions: [],
answers:
[ { name: 'myhost.local',
type: 'AAAA',
class: 1,
ttl: 120,
flush: true,
data: 'fe80::xxxx:xxxx:xxxx:xxxx' },
{ name: 'myhost.local',
type: 'A',
class: 1,
ttl: 120,
flush: true,
data: '192.168.0.10' } ],
authorities: [],
additionals:
[ { name: 'myhost.local',
type: 'NSEC',
class: 1,
ttl: 120,
flush: true,
data: <Buffer ....> } ] }
RESPONSE from this script
{ id: 0,
type: 'response',
flags: 0,
questions: [],
answers:
[ { name: 'myhost.local',
type: 'A',
class: 1,
ttl: 0,
flush: false,
data: '192.168.0.10' } ],
authorities: [],
additionals: [] }