anchor.diff:  %% used to determine if the zone requires updating.
   %%
   %% This function will build the necessary Zone record before inserting.
  +%% @end
   -spec put_zone({binary(), binary(), [#dns_rr{}]}) -> ok | {error, Reason :: term()}.
   put_zone({Name, Sha, Records, AllowNotifyList, AllowTransferList, AllowUpdateList, AlsoNotifyList,
             NotifySourceIP}) ->
  
positive.code: query_master_for_records(MasterIP, ServerIP, QueryList) ->
      erldns_zone_transfer_worker:query_for_records(MasterIP, ServerIP, QueryList).
  
  %% @doc This functin recieves a list of dns_rr records and does all the magic as far as geolocation.
  %% It will remove geolocation records, and match geolocation data with the record. It will remove duplicates
  -spec match_georecords(inet:ip_address(),  dns:dname(), dns:type()) -> [dns:rr()].
  %% TEST FUNCTIONS ----------------------------------
  match_georecords({127,0,0,1}, Qname, Qtype) ->
  
negative.code:     end.
  
  %% @doc This function takes all the records in the zone, and filters out them by looking for
  %% those of the same type and region in the name _geo.[REGION].example.com. If none are found
  %% it trys to find georecords with a wildcard in the name.
  %% @end
  -spec filter_georecords(binary(), dns:dname(), dns:type()) -> [dns:rr()].
  filter_georecords(RegionName, QName, QType) ->
      case get_zone_with_records(QName) of
          {ok, Zone} ->
              filter_georecords(RegionName, QName, QType, Zone#zone.records, []);
          _ ->
              [_ | Rest] = dns:dname_to_labels(QName),
              %% Wildcard for geo records. ex) _geo.[REGION].*.example.com
              WildcardName = <<"_geo.", RegionName/binary, ".", (dns:labels_to_dname([<<"*">>] ++ Rest))/binary>>,
              filter_record_set(erldns_zone_cache:get_records_by_name(WildcardName))
      end.
  