anchor.diff:  timestamp() ->
       {TM, TS, _} = os:timestamp(),
       (TM * 1000000) + TS.
  +
  +%% @doc This function takes a list of records and an authority records. Removes old authority in the
  +%% record list and adds the new authority. Returns the new record list
  +%% @end
  +-spec remove_old_soa_add_new([dns:rr()], dns:rr()) -> [dns:rr()].
  +remove_old_soa_add_new(Records, NewAuthority) ->
  +    remove_old_soa_add_new(NewAuthority, Records,  []).
  +
  +remove_old_soa_add_new(_NewAuthority, [],  NewRecords) ->
  +    NewRecords;
  +remove_old_soa_add_new(NewAuthority, [Record | Records], NewRecords) ->
  +    case Record#dns_rr.data of
  +        #dns_rrdata_soa{} ->
  +            remove_old_soa_add_new(NewAuthority, Records, [NewAuthority | NewRecords]);
  +        _ ->
  +            remove_old_soa_add_new(NewAuthority, Records, [Record | NewRecords])
  +    end.
positive.code:     SOA = SOA0#dns_rrdata_soa{serial = Serial + 1},
      Zone = build_zone(ZoneName, Zone0#zone.allow_notify, Zone0#zone.allow_transfer,
          Zone0#zone.allow_update, Zone0#zone.also_notify, Zone0#zone.notify_source, Zone0#zone.version,
          [Authority#dns_rr{data = SOA}],  Records),
      %% Put zone back into cache.
      case SendNotify of
          false ->
              put_zone(ZoneName, Zone);
          true ->
              put_zone(ZoneName, Zone),
              send_notify(ZoneName, Zone)
      end.
  
  
negative.code:     SOA = SOA0#dns_rrdata_soa{serial = Serial + 1},
      Zone = build_zone(ZoneName, Zone0#zone.allow_notify, Zone0#zone.allow_transfer,
          Zone0#zone.allow_update, Zone0#zone.also_notify, Zone0#zone.notify_source, Zone0#zone.version,
          [Authority#dns_rr{data = SOA}],  remove_old_soa_add_new(Records, Authority#dns_rr{data = SOA})),
      %% Put zone back into cache.
      ok = delete_zone(ZoneName),
      case SendNotify of
          false ->
              ok = put_zone(ZoneName, Zone);
          true ->
              ok = put_zone(ZoneName, Zone),
              send_notify(ZoneName, Zone)
      end.
  % ----------------------------------------------------------------------------------------------------
  