def print_a_record(data):
    rdlength, rdata = data[:2], data[2:]
assert rdlength == '\x00\x04'
assert len(rdata) == 4
addr_bytes = [ord(c) for c in rdata]
Unbound DNS Server, Python module: inspect response message elements