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

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


Hi,

    An update:  some additional tests with repro 1.10.1 in Windows showed that:

    

    - If you define in the "hosts" file a host name without any dot, ares does NOT resolve it.     

        e.g.  172.28.120.100 xtarget

    - But if you define the host name with at least one dot, ares RESOLVES it.                           

        e.g.  172.28.120.100 xtarget.foo

       

    Browsers (Firefox, Chrome,etc) work OK with both dotted and undotted host names in hosts file.

   

Best Regards.

 

From: slgodin@xxxxxxxxx [mailto:slgodin@xxxxxxxxx] On Behalf Of Scott Godin
Sent: Friday, July 15, 2016 10:54 AM
To: Julio Cabezas <jcabezas@xxxxxxxxxxxxx>
Cc: repro-users <repro-users@xxxxxxxxxxxxxxx>
Subject: Re: [repro-users] repro not consulting hosts file ?

 

I don't know of any changes that would have caused a change in behaviour for the hosts file processing outlined on the wiki.  However I haven't tried to do it personally in a couple of years.

 

The reason the WIN32_SYNCRONOUS_RESOLUTION_ON_ARES_FAILURE is not enabled by default is because it is synchronous and can block the entire stack.  It is really only potentially appropriate for use in simple user agents.  It definitely is not appropriate for use in a server application like repro.  Also there is no support for NAPTR or SRV lookup using this mechanism, it is appropriate host (A/AAAA) lookups only.

 

Scott

 

On Thu, Jul 14, 2016 at 8:08 PM, Julio Cabezas <jcabezas@xxxxxxxxxxxxx> wrote:

Hi,

 

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:

 

Scott

 

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. :
>
>                 172.28.120.100  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
repro-users@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/repro-users

 


_______________________________________________
repro-users mailing list
repro-users@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/repro-users