anchor.diff:      end.
   
   %% @doc Find the SOA record for the given DNS question.
  --spec get_authority(dns:message() | dns:dname()) -> {error, no_question} | {error, authority_not_found} | {ok, dns:rr()}.
  +-spec get_authority(dns:message() | dns:dname()) -> {error, no_question}
  +                                                        | {error, authority_not_found} | {ok, dns:rr()}.
   get_authority(Message) when is_record(Message, dns_message) ->
  -  case Message#dns_message.questions of
  -    [] -> {error, no_question};
  -    Questions -> 
  -      Question = lists:last(Questions),
  -      get_authority(Question#dns_query.name)
  -  end;
  +    case Message#dns_message.questions of
  +        [] -> {error, no_question};
  +        Questions ->
  +            Question = lists:last(Questions),
  +            get_authority(Question#dns_query.name)
  +    end;
   get_authority(Name) ->
  -  case find_zone_in_cache(normalize_name(Name)) of
  -    {ok, Zone} ->
  -        {ok, Zone#zone.authority};
  -    _ -> {error, authority_not_found}
  -  end.
  +    case find_zone_in_cache(normalize_name(Name)) of
  +        {ok, Zone} ->
  +            {ok, Zone#zone.authority};
  +        _ -> {error, authority_not_found}
  +    end.
   
   %% @doc Get the list of NS and glue records for the given name. This function
   %% will always return a list, even if it is empty.
   -spec get_delegations(dns:dname()) -> [dns:rr()] | [].
   get_delegations(Name) ->
  -  case find_zone_in_cache(Name) of
  -    {ok, Zone} ->
  -      lists:filter(fun(R) -> apply(erldns_records:match_type(?DNS_TYPE_NS), [R]) and apply(erldns_records:match_glue(Name), [R]) end, Zone#zone.records);
  -    _ ->
  -      []
  -  end.
  +    case find_zone_in_cache(Name) of
  +        {ok, Zone} ->
  +            lists:filter(fun(R)
  +                            -> apply(erldns_records:match_type(?DNS_TYPE_NS), [R]) and
  +                                   apply(erldns_records:match_glue(Name), [R]) end, Zone#zone.records);
  +        _ ->
  +            []
  +    end.
   
   %% @doc Return the record set for the given dname.
   -spec get_records_by_name(dns:dname()) -> [dns:rr()].
   get_records_by_name(Name) ->
       case find_zone_in_cache(Name) of
           {ok, Zone} ->
  -%%              erldns_log:info("~p-> found zone: ~p~n~n", [?MODULE, Zone]),
  +            %%erldns_log:info("~p-> found zone: ~p~n~n", [?MODULE, Zone]),
               case dict:find(normalize_name(Name), Zone#zone.records_by_name) of
                   {ok, RecordSet} ->
  -%%                      erldns_log:info("~p-> Record Set: ~p", [?MODULE, RecordSet]),
  +                    %%erldns_log:info("~p-> Record Set: ~p", [?MODULE, RecordSet]),
                       remove_expiry(RecordSet);
                   _ -> []
               end;
  
positive.code: %% @doc Delete a record from a particular zone.
  -spec delete_record(binary(), #dns_rr{}, boolean()) -> ok | {error, term()}.
  delete_record(ZoneName, #dns_rr{} = Record, SendNotify) ->
      {ok, Zone0} = get_zone_with_records(normalize_name(ZoneName)),
      Records0 = Zone0#zone.records,
      Records = lists:delete(Record, Records0),
      %% Update serial number
      Authority = hd(Zone0#zone.authority),
      SOA0 = Authority#dns_rr.data,
      Serial = SOA0#dns_rrdata_soa.serial,
      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
  
negative.code: %% @doc Add a record to a particular zone.
  -spec add_record(binary(), #dns_rr{}, boolean()) -> ok | {error, term()}.
  add_record(ZoneName, #dns_rr{} = Record, SendNotify) ->
      {ok, #zone{allow_notify = AllowNotify, allow_transfer = AllowTransfer, allow_update = AllowUpdate,
                 also_notify = AlsoNotify, notify_source = NotifySource, version = Version, records = Records0,
                 authority = [#dns_rr{data = #dns_rrdata_soa{serial = Serial} = SOA0}] = [Authority]}}
          = get_zone_with_records(normalize_name(ZoneName)),
      %% Ensure no exact duplicates are found
      [true = Record =/= X || X <- Records0],
      %% Update serial number
      NewAuth = Authority#dns_rr{data = SOA0#dns_rrdata_soa{serial = Serial + 1}},
      Zone = build_zone(ZoneName, AllowNotify, AllowTransfer, AllowUpdate, AlsoNotify, NotifySource,
                        Version, [NewAuth], remove_old_soa_add_new([Record | Records0], NewAuth)),
      %% Put zone back into cache. And send notify if needed.
      ok = delete_zone(ZoneName),
      case SendNotify of
  