anchor.diff:  	    {reply, ok, State};
   
   	clear_cache ->
  -	    ets:match_delete(State#state.cache, '_'),
  +	    ets:delete_all_objects(State#state.cache),
   	    {reply, ok, State};
   
   	reset ->
  
positive.code:     end,
      Db = ets:new(inet_db, [public, named_table]),
      reset_db(Db),
      CacheOpts = [public, bag, {keypos,#dns_rr.domain}, named_table],
      Cache = ets:new(inet_cache, CacheOpts),
      HostsByname = ets:new(inet_hosts_byname, [named_table]),
      HostsByaddr = ets:new(inet_hosts_byaddr, [named_table]),
      HostsFileByname = ets:new(inet_hosts_file_byname, [named_table]),
  
negative.code:     TM = times(),
      case alloc_entry(Db, CacheDb, TM) of
  	true ->
  	    cache_rr(CacheDb, RR#dns_rr{tm = TM, cnt = TM});
  	_ ->
  	    false
      end.
  
  cache_rr(Cache, RR) ->
      ets:insert(Cache, {cache_key(RR), RR}).
  
  times() ->
      erlang:monotonic_time(second).
      %% erlang:convert_time_unit(erlang:monotonic_time() - erlang:system_info(start_time),
      %%     		     native, second).
  
  %% match and remove old entries
  
  match_rr({_, _, _} = Key) ->
      Time = times(),
      case ets:lookup(inet_cache, Key) of
  	[{_,RR}] when RR#dns_rr.ttl =:= 0 -> %% at least once
  	    ets:delete(inet_cache, Key),
  	    [RR];
  	[{_,RR}] when RR#dns_rr.tm + RR#dns_rr.ttl < Time ->
  	    ets:delete(inet_cache, Key),
  	    [];
  	[{_,RR}] ->
          %% This may fail if cache pruning removes this entry
          %% at the same time we are updating it, so ignore the result.
  	    _ = ets:update_element(inet_cache, Key, {2, RR#dns_rr{cnt = Time}}),
  	    [RR];
  	[] ->
  	    []
      end.
  
  cache_key(#dns_rr{domain = Domain, class = Class, type = Type}) ->
      {Domain, Class, Type}.
  
  %% Lower case the domain name before storage.
  %%
  