anchor.diff:      end,
       Db = ets:new(inet_db, [public, named_table]),
       reset_db(Db),
  -    Cache = ets:new(inet_cache, [public, set, named_table]),
  +    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]),
  
positive.code: 
  %% Delete entries with latest access time older than TM.
  %% Delete max N number of entries.
  %% Returns the number of deleted entries.
  delete_older(CacheDb, TM, N) ->
      true = ets:safe_fixtable(CacheDb, true),
      Res = delete_older(ets:first(CacheDb), CacheDb, TM, N, 0),
      true = ets:safe_fixtable(CacheDb, false),
      Res.
  
  delete_older('$end_of_table', _, _, _, M) ->
      M;
  delete_older(_, _, _, M, M) ->
      M;
  delete_older(Key, CacheDb, TM, N, M) ->
      Next = ets:next(CacheDb, Key),
      M1 =
  	case ets:lookup(CacheDb, Key) of
  	    [{_,_,Cnt}] when Cnt =< TM ->
  		ets:delete(CacheDb, Key),
  		M + 1;
  	    _ ->
  		M
  	  end,
      delete_older(Next, CacheDb, TM, N, M1).
  
  
  %% as lists:delete/2, but delete all exact matches
  
negative.code: 	    do_add_rr(RR, Db, State),
  	    {reply, ok, State};
  
  	{del_rr, RR} when is_record(RR, dns_rr) ->
  	    Cache = State#state.cache,
              ets:match_delete(Cache, RR),
  	    {reply, ok, State};
  
  	{listop, Opt, Op, E} ->
  