anchor.diff:      end.
   
   
  -%% handle_minfo/1
  -%% ====================================================================
  +%%--------------------------------------------------------------------
   %% @doc Handles DNS queries of type MINFO.
  -%% See {@link dns_query_handler_behaviour} for reference.
  -%% @end
  -%% ====================================================================
  +%% See {@link dns_handler_behaviour} for reference.
  +%% @end
  +%%--------------------------------------------------------------------
   -spec handle_minfo(DomainNotNormalized :: string()) -> dns_handler_behaviour:handler_reply().
  -%% ====================================================================
   handle_minfo(DomainNotNormalized) ->
       case parse_domain(DomainNotNormalized) of
           unknown_domain ->
  
positive.code:     end.
  
  
  %% ===================================================================
  %% Internal functions
  %% ===================================================================
  
  %% parse_domain/1
  %% ====================================================================
  %% @doc Analyzes a domain name - normalizes it (deletes leading www), extracts subdomain prefix
  %% and finds a matching zone from config, if existent.
  %% @end
  %% ====================================================================
  -spec parse_domain(Domain :: string()) -> {NormalizedDomain :: string(), Prefix :: string(), Suffix :: string(), DNSZone :: #dns_zone{}} | unknown_domain.
  %% ====================================================================
  parse_domain(DomainArg) ->
      % If requested domain starts with 'www.', ignore it
      Domain = case DomainArg of
  
negative.code:     application:set_env(?APP_Name, dns_zones, DNSConfig).
  
  
  %%--------------------------------------------------------------------
  %% @doc Returns canonical hostname as specified in dns.config.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_canonical_hostname() -> string().
  get_canonical_hostname() ->
      {ok, [#dns_zone{cname = Hostname} | _]} = application:get_env(?APP_Name, dns_zones),
      Hostname.
  
  
  %%%===================================================================
  %%% dns_handler_behaviour API
  %%%===================================================================
  
  %%--------------------------------------------------------------------
  %% @doc Handles DNS queries of type A.
  %% See {@link dns_handler_behaviour} for reference.
  %% @end
  %%--------------------------------------------------------------------
  -spec handle_a(DomainNotNormalized :: string()) -> dns_handler_behaviour:handler_reply().
  handle_a(DomainNotNormalized) ->
      case parse_domain(DomainNotNormalized) of
          unknown_domain ->
  