anchor.diff:  %% Function for executing custom lookups by registered handlers.
   -spec custom_lookup(dns:dname(), dns:type(), [dns:rr()]) -> fun(({module(), [dns:type()]}) -> [dns:rr()]).
   custom_lookup(Qname, Qtype, Records) ->
  -  fun({Module, Types}) ->
  -      case lists:member(Qtype, Types) of
  -        true -> Module:handle(Qname, Qtype, Records);
  -        false ->
  -          case Qtype =:= ?DNS_TYPE_ANY of
  -            true -> Module:handle(Qname, Qtype, Records);
  -            false -> []
  -          end
  -      end
  -  end.
  -
  -% Function for filtering out custom records and replcing them with
  -% records which content from the custom handler.
  +    fun({Module, Types}) ->
  +            case lists:member(Qtype, Types) of
  +                true -> Module:handle(Qname, Qtype, Records);
  +                false ->
  +                    case Qtype =:= ?DNS_TYPE_ANY of
  +                        true -> Module:handle(Qname, Qtype, Records);
  +                        false -> []
  +                    end
  +            end
  +    end.
  +
  +%% Function for filtering out custom records and replcing them with
  +%% records which content from the custom handler.
   filter_records(Records, []) -> Records;
   filter_records(Records, [{Handler,_}|Rest]) ->
  -  filter_records(Handler:filter(Records), Rest).
  -
  -
  +    filter_records(Handler:filter(Records), Rest).
   
   %% According to RFC 2308 the TTL for the SOA record in an NXDOMAIN response
   %% must be set to the value of the minimum field in the SOA content.
  -rewrite_soa_ttl(Message) -> rewrite_soa_ttl(Message, Message#dns_message.authority, []).
  -rewrite_soa_ttl(Message, [], NewAuthority) -> Message#dns_message{authority = NewAuthority};
  -rewrite_soa_ttl(Message, [R|Rest], NewAuthority) -> rewrite_soa_ttl(Message, Rest, NewAuthority ++ [erldns_records:minimum_soa_ttl(R, R#dns_rr.data)]).
  +rewrite_soa_ttl(Message) ->
  +    rewrite_soa_ttl(Message, Message#dns_message.authority, []).
  +
  +rewrite_soa_ttl(Message, [], NewAuthority) ->
  +    Message#dns_message{authority = NewAuthority};
  +rewrite_soa_ttl(Message, [R|Rest], NewAuthority) ->
  +    rewrite_soa_ttl(Message, Rest, NewAuthority ++ [erldns_records:minimum_soa_ttl(R, R#dns_rr.data)]).
   
   
   %% See if additional processing is necessary.
   additional_processing(Message, _ClientIP, {error, _}) ->
  -  Message;
  +    Message;
   additional_processing(Message, ClientIP, Zone) ->
  -  RequiresAdditionalProcessing = requires_additional_processing(Message#dns_message.answers ++ Message#dns_message.authority, []),
  -  additional_processing(Message, ClientIP, Zone, lists:flatten(RequiresAdditionalProcessing)).
  +    RequiresAdditionalProcessing = requires_additional_processing(Message#dns_message.answers ++
  +                                                                      Message#dns_message.authority, []),
  +    additional_processing(Message, ClientIP, Zone, lists:flatten(RequiresAdditionalProcessing)).
   %% No records require additional processing.
   additional_processing(Message, _ClientIP, _Zone, []) ->
  -  Message;
  +    Message;
   %% There are records with names that require additional processing.
   additional_processing(Message, ClientIP, Zone, Names) ->
  -  RRs = lists:flatten(lists:map(fun(Name) -> erldns_zone_cache:get_records_by_name(Name) end, Names)),
  -  Records = lists:filter(erldns_records:match_types([?DNS_TYPE_A, ?DNS_TYPE_AAAA]), RRs),
  -  additional_processing(Message, ClientIP, Zone, Names, Records).
  +    RRs = lists:flatten(lists:map(fun(Name) -> erldns_zone_cache:get_records_by_name(Name) end, Names)),
  +    Records = lists:filter(erldns_records:match_types([?DNS_TYPE_A, ?DNS_TYPE_AAAA]), RRs),
  +    additional_processing(Message, ClientIP, Zone, Names, Records).
   
   %% No additional A records were found, so just return the message.
   additional_processing(Message, _ClientIP, _Zone, _Names, []) ->
  -  Message;
  +    Message;
   %% Additional A records were found, so we add them to the additional section.
   additional_processing(Message, _ClientIP, _Zone, _Names, Records) ->
  -  Message#dns_message{additional=Message#dns_message.additional ++ Records}.
  -
  -
  +    Message#dns_message{additional=Message#dns_message.additional ++ Records}.
   
   %% Given a list of answers find the names that require additional processing.
   requires_additional_processing([], RequiresAdditional) -> RequiresAdditional;
   requires_additional_processing([Answer|Rest], RequiresAdditional) ->
  -  Names = case Answer#dns_rr.data of
  -            Data when is_record(Data, dns_rrdata_ns) -> [Data#dns_rrdata_ns.dname];
  -            Data when is_record(Data, dns_rrdata_mx) -> [Data#dns_rrdata_mx.exchange];
  -            _ -> []
  -          end,
  -  requires_additional_processing(Rest, RequiresAdditional ++ Names).
  +    Names = case Answer#dns_rr.data of
  +                Data when is_record(Data, dns_rrdata_ns) -> [Data#dns_rrdata_ns.dname];
  +                Data when is_record(Data, dns_rrdata_mx) -> [Data#dns_rrdata_mx.exchange];
  +                _ -> []
  +            end,
  +    requires_additional_processing(Rest, RequiresAdditional ++ Names).
   
   %% @doc Returns a list of #dns_rr records and the SOA
   %% @end
  
positive.code:     {ok, Zone} = erldns_zone_cache:get_zone_with_records(Qname), % Zone lookup
      %%  Check to make sure the requester is allowed the axfr, and that the server is the master for
      %%  the zone
      case lists:member(ClientIP, Zone#zone.allow_transfer) andalso lists:member(ServerIP, Zone#zone.allow_notify) of
          true ->
              RecordsWithSOA = Zone#zone.records,
              {RecordsNoSOA, SOA} = get_soa(RecordsWithSOA),
  
negative.code: %% @doc Resolve the questions in the message.
  -spec resolve(dns:message(), [dns:rr()], dns:ip()) -> dns:message().
  resolve(Message, AuthorityRecords, {ClientIP, ServerIP}) ->
      resolve(Message, AuthorityRecords, {ClientIP, ServerIP}, Message#dns_message.questions).
  
  %% There were no questions in the message so just return it.
  -spec resolve(dns:message(), [dns:rr()], dns:ip(), dns:ip(), [dns:question()]) -> dns:message().
  resolve(Message, _AuthorityRecords, {_ClientIP, _ServerIP}, []) -> Message;
  %% There is one question in the message; resolve it.
  resolve(Message, AuthorityRecords, {ClientIP, ServerIP}, [Question]) ->
      resolve(Message, AuthorityRecords, {ClientIP, ServerIP}, Question);
  %% Resolve the first question. Additional questions will be thrown away for now.
  resolve(Message, AuthorityRecords, {ClientIP, ServerIP}, [Question|_]) ->
      resolve(Message, AuthorityRecords, {ClientIP, ServerIP}, Question);
  
  %% Start the resolution process on the given question.
  %% Step 1: Set the RA bit to false as we do not handle recursive queries.
  resolve(Message, AuthorityRecords, {ClientIP, ServerIP}, Question) when is_record(Question, dns_query) ->
      resolve(Message#dns_message{ra = false}, AuthorityRecords, Question#dns_query.name,
              Question#dns_query.type, {ClientIP, ServerIP}).
  
  %% With the extracted Qname and Qtype in hand, find the nearest zone
  %% Step 2: Search the available zones for the zone which is the nearest ancestor to QNAME
  