devasia2112
devasia2112

Reputation: 6034

How to properly access de BIND DNS to write in some of the files?

My Environment:

I'm using: OpenSuse 11.4 kernel 2.6.x.x; Apache 2.2; PHP 5.3; MySQL 5.5 Community; Pearl 5 version 12 and Bash.

I have been used BIND DNS, the whole process until now is manually (Add, Update, Get, etc..) hosts.

Now I need to develop some automation for this kind of task as I mentioned above. The problem is I do not want to use Cpanel, WHM or whatever software in the market to do this.. I'm looking to develop some script in perl or php or whatever language it need to be.. I really want something very simple that I just need to query the database to get all the information I need and execute the operation in the BIND.

I intend to use cronjob to fire the "script" to query the information of new hosts added in my table and then execute BIND.

I do not know if I was clear enough, if not please ask me.

I do not have anything yet. I'm just grabbing some ideas for a while.

Cheers.

[EDITED]

I need to Add, Delete, Update, Get and Set information in my DNS Zone. Create the files every time the script query the database and after export to BIND.

Upvotes: 1

Views: 275

Answers (1)

Borealid
Borealid

Reputation: 98559

  • Bind has a nice tool included called nsupdate which allows you to edit the zone from the command line. You should use that if you're writing a script.

  • Bind can run backed by a database; when you do this, updating the database updates the zone. There are no zone files at all!

Upvotes: 2

Related Questions