def fromjson (json):
data = json.loads(json)
if data.type !='SRV' and data.type!='MX':
record = f'{data.host} IN {data.type} {data.content}'
if data.type=='MX':
record = f'{data.host} IN MX {data.priority} {data.content}'
if data.type=='SRV':
record = f"_{data.service}._{data.proto}.{data.name}. IN SRV {data.priority} {data.weight} {data.port} {data.target}"
return record