www.webdeveloper.com
Results 1 to 6 of 6

Thread: Change rDNS records with PHP

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    131

    Change rDNS records with PHP

    Hey WD.com,

    How would I go about changing the rDNS records of any number of IP's with strictly PHP? Is that even possible?

    My gut tells me that I will need to do some serious modification of the /etc/hosts file and keep reloading Apache, but I was hoping for something better.

    Any ideas? Thank you!


    Pierce
    Refreshed | Web Design
    Your Dreams. Our Reality. Refreshing, isn't it?
    Pierce@RefreshedWeb.com
    https://www.RefreshedWeb.com

  2. #2
    Join Date
    Nov 2008
    Posts
    2,477
    Generally your hosting provider or ISP are responsible for reverse DNS records - unless they provide some sort of API to interact with their system you won't be able to do this yourself. Your hosts file will only affect forward DNS lookups not reverse.
    Last edited by Mindzai; 04-13-2010 at 03:21 AM.
    The first rule of Tautology Club is the first rule of Tautology Club.

  3. #3
    Join Date
    Jun 2009
    Posts
    131
    That's the thing, I am working on a system that is a dedicated/vps hosting company admin control panel, which needs to include the functionality that allows for the changing of reverse dns. I know it will be difficult and complicated, I just have absolutely no idea where to start.

    Is rDNS something that is run from a database in the hosting company's server? Or is this a server configuration issue?
    Refreshed | Web Design
    Your Dreams. Our Reality. Refreshing, isn't it?
    Pierce@RefreshedWeb.com
    https://www.RefreshedWeb.com

  4. #4
    Join Date
    Nov 2008
    Posts
    2,477
    If you are hosting the DNS server yourself and you control the relevant IP blocks then it is just a case of creating the necessary PTR records. The best place to start would be the documentation for your DNS server. Once you figure out how this works you should be able to automate the process with PHP.
    The first rule of Tautology Club is the first rule of Tautology Club.

  5. #5
    Join Date
    Jul 2009
    Location
    Falls Church, Va.
    Posts
    780
    Hints for DIY: Many dns servers use simple flat files called "zone files" which contain the data to setup the DNS, both fwd and in-addr (reverse). Check the documentation to find the location of the actual zone files, make sure you have permission to edit them (use PHP to load them into a form or editor and save) then update the SOA or serial, run whatever the command is to update the DNS cache and propagate the change if you want faster time to live (TTL) than the default.

    Requires knowledge of DNS. Most *nix uses Bind for the nameserver daemon.

    I posted this so you know the right basic terminology to find scripts or create your own.

    -jim

  6. #6
    Join Date
    Jun 2009
    Posts
    131
    Thanks for the responses, I sincerely appreciate them.

    Upon further research into the issue with the server admin, it turns out that they use PowerDNS with a MySQL backend to run their DNS. It seems that this is an easier system for a developer inexperienced in DNS to manage. Now, if I could just figure out exactly how this picky system wants me to insert DNS records...
    Refreshed | Web Design
    Your Dreams. Our Reality. Refreshing, isn't it?
    Pierce@RefreshedWeb.com
    https://www.RefreshedWeb.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles