Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ANN] cares removed. #23

Open
chobie opened this issue Sep 15, 2012 · 8 comments
Open

[ANN] cares removed. #23

chobie opened this issue Sep 15, 2012 · 8 comments

Comments

@chobie
Copy link
Owner

chobie commented Sep 15, 2012

joyent/libuv#518

https://github.com/chobie/php-uv/tree/develop

TODO: take a look into PECL ares and write how to migrate bundled functions.

@xming
Copy link

xming commented Mar 27, 2013

Or maybe port this https://code.google.com/p/netdns2/source/browse/trunk/Net/DNS2.php to use php-uv?

@igorw
Copy link

igorw commented Mar 27, 2013

@xming for userland DNS take a look at react/dns. We're in the process of integrating the libuv loop so that they can be composed.

I would really like to see an updated version of the ares pecl extension though. I couldn't get the current one to work properly.

@xming
Copy link

xming commented Mar 28, 2013

It works for me. I am using

  • Gentoo Linux
  • c-ares 1.7.4
  • php 5.4.13

How to:

<?php
$a = ares_init();
function cb()
{
        $argv = func_get_args();
        print_r($argv);
}
ares_gethostbyname($a, "cb", "google.com");
ares_gethostbyaddr($a, "cb", "8.8.8.8");

ares_process_all($a);
ares_destroy($a);

produces

Array
(
    [0] => Resource id #6
    [1] => 0
    [2] => stdClass Object
        (
            [name] => google-public-dns-a.google.com
            [aliases] => Array
                (
                    [0] => google-public-dns-a.google.com
                )

            [addrtype] => 2
            [addrlist] => Array
                (
                    [0] => 8.8.8.8
                )

        )

)
Array
(
    [0] => Resource id #5
    [1] => 0
    [2] => stdClass Object
        (
            [name] => google.com
            [aliases] => Array
                (
                )

            [addrtype] => 2
            [addrlist] => Array
                (
                    [0] => 74.125.136.113
                    [1] => 74.125.136.102
                    [2] => 74.125.136.100
                    [3] => 74.125.136.138
                    [4] => 74.125.136.101
                    [5] => 74.125.136.139
                )

        )

)

Any ideas how I can make custom queries? MX. SOA, TXT, ....

@xming
Copy link

xming commented Mar 28, 2013

Ah got it

ares_search($a, "cb", "google.com", ARES_T_MX);
ares_search($a, "cb", "google.com", ARES_T_SOA);

@igorw
Copy link

igorw commented Mar 28, 2013

Cool, I was probably missing the OSX support.

@xming
Copy link

xming commented Mar 28, 2013

Isn't that patch from you? :D

@chobie
Copy link
Owner Author

chobie commented Mar 28, 2013

yea, I sent a patch. but some features does not work properly on my osx 😢

@xming
Copy link

xming commented Mar 28, 2013

Such as? Maybe I can test them here on linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants