Change rDNS records with PHP
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!
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 04:21 AM.
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?
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.
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.
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...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread