FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19178&edit=1

ID: 19178
Updated by: hm2k@php.net
Reported By: stevekamerman at gmail dot com
Summary: Resolver Nameservers not set
Status: Open
Type: Bug
Package: Net_DNSBL
Operating System: Windows 7 x64 / Wampserver
Package Version: 1.3.6
PHP Version: 5.3.5
Roadmap Versions:
New Comment:

What makes you think that the blacklist can always be used as a name
server?


Previous Comments:
------------------------------------------------------------------------

[2012-01-01 19:38:38] kamermans

Description:
------------
Not sure if this is by design, but DNSBL makes no attempt to
set the nameservers on the Net_DNS_Resolver object before
querying. This may work most of the time since the system's
default nameservers may be used, but for me it failed. I
would think it better to query the DNSBL directly, instead of
querying your default DNS servers, since most requests will
be unique and uncached anyway.

To fix, add this line after the foreach() on line 223:
$resolver->set_nameservers($blacklist);

Additionally, if no nameservers are present for
Net_DNS_Resolver, $resolver->query() returns null, which is
miss-interpreted on line 226 as false: "if ($response)", so
DNSBL::isListed() will always return false.


Test script:
---------------
$dnsbl = new Net_DNSBL();
$dnsbl->setBlacklists(array('dnsbl.tornevall.org'));
var_export($dnsbl->isListed('83.30.131.78'));
// This IP is listed at time of testing; 1/1/2012 1:01 PM

Expected result:
----------------
true

Actual result:
--------------
false

------------------------------------------------------------------------

Search Discussions

  • Stevekamerman at Jan 3, 2012 at 3:02 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19178&edit=1

    ID: 19178
    Updated by: stevekamerman@gmail.com
    Reported By: stevekamerman at gmail dot com
    Summary: Resolver Nameservers not set
    Status: Open
    Type: Bug
    Package: Net_DNSBL
    Operating System: Windows 7 x64 / Wampserver
    Package Version: 1.3.6
    PHP Version: 5.3.5
    Roadmap Versions:
    New Comment:

    A DNSBL/RBL, by definition, is a DNS server. However, after trying this
    for a bit I
    realized that there is a high timeout on UDP sockets in PHP, so it still
    better to query a
    nameserver that is always up (i.e. your own), so I guess I'll retract my
    suggestion :)


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-03 15:59:42] hm2k

    What makes you think that the blacklist can always be used as a name
    server?

    ------------------------------------------------------------------------

    [2012-01-01 19:38:38] kamermans

    Description:
    ------------
    Not sure if this is by design, but DNSBL makes no attempt to
    set the nameservers on the Net_DNS_Resolver object before
    querying. This may work most of the time since the system's
    default nameservers may be used, but for me it failed. I
    would think it better to query the DNSBL directly, instead of
    querying your default DNS servers, since most requests will
    be unique and uncached anyway.

    To fix, add this line after the foreach() on line 223:
    $resolver->set_nameservers($blacklist);

    Additionally, if no nameservers are present for
    Net_DNS_Resolver, $resolver->query() returns null, which is
    miss-interpreted on line 226 as false: "if ($response)", so
    DNSBL::isListed() will always return false.


    Test script:
    ---------------
    $dnsbl = new Net_DNSBL();
    $dnsbl->setBlacklists(array('dnsbl.tornevall.org'));
    var_export($dnsbl->isListed('83.30.131.78'));
    // This IP is listed at time of testing; 1/1/2012 1:01 PM

    Expected result:
    ----------------
    true

    Actual result:
    --------------
    false

    ------------------------------------------------------------------------
  • Hm2k at Jan 3, 2012 at 3:29 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19178&edit=1

    ID: 19178
    Updated by: hm2k@php.net
    Reported By: stevekamerman at gmail dot com
    Summary: Resolver Nameservers not set
    -Status: Open
    +Status: Closed
    Type: Bug
    Package: Net_DNSBL
    Operating System: Windows 7 x64 / Wampserver
    Package Version: 1.3.6
    PHP Version: 5.3.5
    -Assigned To:
    +Assigned To: hm2k
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: hm2k
    I understand your perspective, but I don't think it's strictly true
    anyway.

    A DNSBL could just be passing data from it's own database to the DNS
    server itself.

    It's wrong to assume that a public DNS server is always open on port 53
    via UDP on
    each blacklist host address.

    In interesting suggestion though, but I'm pretty certain that this is a
    DNS (working by
    design) issue, not a DNSBL issue...


    Previous Comments:
    ------------------------------------------------------------------------

    [2012-01-03 16:03:01] kamermans

    A DNSBL/RBL, by definition, is a DNS server. However, after trying this
    for a bit I
    realized that there is a high timeout on UDP sockets in PHP, so it still
    better to query a
    nameserver that is always up (i.e. your own), so I guess I'll retract my
    suggestion :)

    ------------------------------------------------------------------------

    [2012-01-03 15:59:42] hm2k

    What makes you think that the blacklist can always be used as a name
    server?

    ------------------------------------------------------------------------

    [2012-01-01 19:38:38] kamermans

    Description:
    ------------
    Not sure if this is by design, but DNSBL makes no attempt to
    set the nameservers on the Net_DNS_Resolver object before
    querying. This may work most of the time since the system's
    default nameservers may be used, but for me it failed. I
    would think it better to query the DNSBL directly, instead of
    querying your default DNS servers, since most requests will
    be unique and uncached anyway.

    To fix, add this line after the foreach() on line 223:
    $resolver->set_nameservers($blacklist);

    Additionally, if no nameservers are present for
    Net_DNS_Resolver, $resolver->query() returns null, which is
    miss-interpreted on line 226 as false: "if ($response)", so
    DNSBL::isListed() will always return false.


    Test script:
    ---------------
    $dnsbl = new Net_DNSBL();
    $dnsbl->setBlacklists(array('dnsbl.tornevall.org'));
    var_export($dnsbl->isListed('83.30.131.78'));
    // This IP is listed at time of testing; 1/1/2012 1:01 PM

    Expected result:
    ----------------
    true

    Actual result:
    --------------
    false

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 3, '12 at 2:59p
activeJan 3, '12 at 3:29p
posts3
users2
websitepear.php.net

2 users in discussion

Hm2k: 2 posts Stevekamerman: 1 post

People

Translate

site design / logo © 2022 Grokbase