SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to get the dns data with php

    Hello everyone

    I'm working in a project and need a dump (all dns records) from dns server. Is it posible to do this in php. Do someone have a API or something like this.

    thank for help
    bye

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,185
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    dns records

    Better than an API, PHP has a function -
    dns_get_record
    that outputs an array.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, i know this but this function can not be used on Windows platforms

    From php.net
    Description
    array dns_get_record ( string hostname [, int type [, array &authns, array &addtl]] )

    Note: This function is not implemented on Windows platforms, nor does it (currently) work on *BSD systems.
    My Server is a Windows 2003 Server Apache and PHP.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,185
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)

    ...... Pear

    In that case you need the rest of the line you quoted.
    ......... BSD systems. Try the PEAR class Net_DNS.
    http://pear.php.net/package/Net_DNS
    http://builder.com.com/5100-6371-5234651.html

  5. #5
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could exec a system command ... you just then have to parse out the data in a format of use to you
    PHP Code:
    <?
    exec
    ("nslookup -querytype=ANY $domain",$yaks);
    print_r($yaks);
    ?>

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by firepages View Post
    you could exec a system command ... you just then have to parse out the data in a format of use to you
    PHP Code:
    <?
    exec
    ("nslookup -querytype=ANY $domain",$yaks);
    print_r($yaks);
    ?>
    Yes I know this but like I write in my previus post I need all dns Records not only one. In my DNS is about 200 records. Is it posible to get this data with php???


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •