< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [repro-users] repro not consulting hosts file ?



At first, I tried to use etc/resolv.conf for Windows as suggested in https://www.resiprocate.org/DNS, but as I expected it did not work. Seems to be outdated information.

Confirmed: in Windows resiprocate uses ares under rutil\dns.

Confirmed: function "void ares_query(...)" is being called for name resolution. I wasn't able to follow the exact cause why it got no DNS results and still didn't query hosts file


What did work with minimum effort was to follow Dario's suggestion and reactivate the code below #ifdef WIN32_SYNCRONOUS_RESOLUTION_ON_ARES_FAILURE  in DnsResults.cxx

As this code is only called if ares fails to resolve the name, it keeps DNS records conveniently at higher priority than hosts file.


Some questions pop up:

- Why this code was disabled in the past? 

    Because it's a synchronous resolution that hurts performance ? 

    I tried to restrict the name resolution just to hosts file to mitigate that but I wasn't successful so far.

- What can be  other inconvenient effects of running this code ? 

    Obviously the code after the #else clause will not run:  "// .bwc. If this A query failed, don't give up if there are more SRVs!"

    But I guess this can be easily fixed with no drawbacks.


Some ideas ?


Best Regards.



From: repro-users [mailto:repro-users-bounces@xxxxxxxxxxxxxxx] On Behalf Of Scott Godin
Sent: quarta-feira, 29 de junho de 2016 10:22
To: Daniel Pocock <daniel@xxxxxxxxxx>
Cc: repro-users <repro-users@xxxxxxxxxxxxxxx>
Subject: Re: [repro-users] repro not consulting hosts file ?


The default for Windows is to NOT use c-ares, it uses resip-ares which does support hostfile lookups.  However if there is a DNS record in the resip cache or if the DNS server returns an A-record when not found, then it won't go to the hostfile.  I believe it only goes to the hostfile if the DNS server returns no results.


More info here:




On Wed, Jun 29, 2016 at 3:19 AM, Daniel Pocock <daniel@xxxxxxxxxx> wrote:

On 29/06/16 00:56, Julio Cabezas wrote:
> Hi,
>                 I cannot make repro to route an INVITE to “xtarget” when
> I define it in the Windows hosts file as e.g. :
>         xtarget
>                 But when I define “xtarget” as an A record in the
> default DNS for the server where repro runs, the INVITE is correctly
> routed by repro.
>                 I am running repro version 1.10.1  on Windows Server 2012R2.
>                 Any suggestion ?

repro (and all of reSIProcate) use the c-ares DNS library instead of the
normal system libraries to resolve names.

As far as I know, c-ares doesn't support the hosts file

repro-users mailing list