anchor.diff:  		       [Host, Port, UsePort]);
   	true -> true
       end,
  -    DstList = case host_port_to_dstlist(Proto, Host, UsePort, ReqURI) of
  +    %% XXX what if host_port_to_dstlist for this hostname returns a sipdst-record with a
  +    %% different address (because of DNS round-robin, or DNS TTL reaching zero) the second
  +    %% time we query for the very same hostname returned in a siplookup result set?
  +    DstList = case host_port_to_dstlist(Proto, Host, UsePort, ReqURI, SSLHost) of
   		  {error, Reason} ->
   		      logger:log(error, "Warning: Could not make DstList out of ~p:~p:~p : ~p",
   				 [Proto, Host, UsePort, Reason]),
  
positive.code: %%% Created : 15 Apr 2004 by Fredrik Thulin <ft@it.su.se>
  %%%-------------------------------------------------------------------
  -module(sipdst).
  
  %%--------------------------------------------------------------------
  %% External exports
  
negative.code: %%--------------------------------------------------------------------
  %% Function: address_to_address_and_proto(Addr, DefaultProto)
  %%           Addr = term(), something (probably a string()) that is
  %%                  parseable by inet_parse:ipv{4,6}_address() (should
  %%                  be an IPv4 or IPv6 address, not a hostname!)
  %%           DefaultProto = atom(), tcp | udp | tls
  %% Descrip.: When looking at Via headers, we often have a protocol
  %%           from the SIP/2.0/FOO but we need to look at the
  %%           address to determine if our sipdst proto should be
  %%           foo or foo6. This function does that.
  %% Returns : {ok, Address, Proto} |
  %%           {error, Reason}
  %%           Address = term(), parsed version of Addr
  %%           Proto   = atom(), tcp | udp | tcp6 | udp6 | tls | tls6
  %%           Reason  = string()
  %%--------------------------------------------------------------------
  address_to_address_and_proto(Addr, DefaultProto) when DefaultProto == tcp; DefaultProto == udp; DefaultProto == tls ->
      case inet_parse:ipv4_address(Addr) of
  	{ok, _IPtuple} ->
  	    {ok, Addr, DefaultProto};
  	_ ->
  	    case sipserver:get_env(enable_v6, false) of
  		true ->
  		    %% Check if it matches IPv6 address syntax
  		    case inet_parse:ipv6_address(util:remove_v6_brackets(Addr)) of
  			{ok, _IPtuple} ->
  			    Proto6 = case DefaultProto of
  					 tcp -> tcp6;
  					 udp -> udp6;
  					 tls -> tls6
  				     end,
  			    {ok, Addr, Proto6};
  			_ ->
  			    {error, "not an IPv4 or IPv6 address"}
  		    end;
  