<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 12/03/15 17:51, canuck15 wrote:<br>
    </div>
    <blockquote
      cite="mid:BLU436-SMTP667FC434527F976E194E96DA060@phx.gbl"
      type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      I am reading the documentation for the ipops module
      dns_int_match_ip() function and it states the following:<br>
      <br>
      "<span style="color: rgb(0, 0, 0); font-family: Helvetica, Arial;
        font-size: 12px; font-style: normal; font-variant: normal;
        font-weight: normal; letter-spacing: normal; line-height:
        normal; orphans: auto; text-align: justify; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 1;
        word-spacing: 0px; -webkit-text-stroke-width: 0px; display:
        inline !important; float: none; background-color: rgb(255, 255,
        255);">Returns TRUE if ipaddr is associated by DNS to hostname.
        FALSE otherwise. It uses internal DNS resolver. At this moment,
        the function might not check all the IP addresses as returned by
        dns_sys_match_ip(), because the internal resolver targets to
        discover the first address to be used for relaying SIP traffic.
        Thus is better to use dns_sys_match_ip() if the host you want to
        check has many IP addresses, in different address famililies
        (IPv4/6)."<br>
        <br>
        I am not sure what that statement means.  I will be using this
        for IP authentication where the records it is checking against
        are in a mysql database and may or may not be be using the DNS
        name instead of the IP.  Many of those DNS names could return
        several IP addresses and the incoming call could be on any one
        of those IP addresses.  So when I do a check of a hostname
        against an IP address I want all returned A or srv IP's to be
        checked against the IP.  Not just the first IP returned when
        checked.  I do not believe dns_sys_match() will be fast enough
        on a busy server so I would prefer to using dns_int_match_ip().
        <br>
        <br>
        If anyone can clarify what that statement means regarding
        "internal resolver targets to discover the first address" and
        whether that would affect my use it would be greatly
        appreciated.<br>
        <br>
        On a related note, is there any way to check the contents of the
        dns resolver cache?  I looked through kamctl and kamcmd but
        didn't find anything.  I tried "kamctl address show" but that
        didn't return anything. <br>
      </span></blockquote>
    the internal DNS resolver is optimized for sending out SIP requests
    and uses an embedded cache. It can result that some DNS responses
    are cached and kept in memory for a while. Also, there are
    parameters in core of kamailio to tune what kind of dns requests to
    do (NAPTR, SRV, ...). Based on those, not all options to discover
    the ip of a hostname for sip forwarding are tried. E.g., it can try
    only SRV for UDP/IPv6 if that is the highest configured priority and
    has a result for forwarding the SIP packet.<br>
    <br>
    In other words, internal DNS doesn't try to discover all the IP
    addresses associated with a hostname, only those relevant for sip
    and can stop at first valid response, not following other dns query
    options that could be eventually done.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>