HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   BIND server in ISPConfig general question... (http://www.howtoforge.com/forums/showthread.php?t=25134)

BorderAmigos 15th July 2008 23:33

BIND server in ISPConfig general question...
 
All the named sites under ISPConfig are up and running well and accessible by domain.name. But the system says BIND is not running on boot up. I can manually start it and all still runs well. This isn't a problem just a general configuration question as ISPConfig seems to be running a separate DNS than the main BIND one. I want to write some code that does dynamic DNS updating of the sites on my server.

Does ISPConfig use the same DNS configuration files as the default BIND? I'm curious how the names are still resolving when the BIND9 server is stopped.

falko 16th July 2008 18:37

Which distribution are you using?

BorderAmigos 16th July 2008 18:43

Debian Etch, Kernel 2.6.18
ISPConfig 2.2.23 (I think)

falko 17th July 2008 16:44

ISPConfig uses the default BIND. Its configuration can be found in /etc/bind/.

BorderAmigos 17th July 2008 18:21

There is no folder /etc/bind on my system. The configuration files are in /var/lib/named/etc/bind/. This is how it was installed by the 'Perfect Server' instructions.

falko 18th July 2008 15:27

But /etc/bind should be a symlink to /var/lib/named/etc/bind...

BorderAmigos 26th July 2008 00:29

Indeed there is, thanks.

I need a script that updates the IP of primary zone files when the IP changes. One way is using nsupdate to directly modify them. But if I'm not mistaken, ISPConfig would wipe out those changes next time it re-creates the VHOSTS.

So, maybe a better idea to write a php script that will update the values in the ispconfig database then trigger a rewrite of the vhosts and a restart of the name server. Does this make sense?

I'm using DynDNS service for the main nameserver domain updates but don't want to pay an account for every domain name I use in addition to that one.

I guess my concern is that ISPConfig would re-read the IP addresses from MySQL before re-writing the zone files, rather than having them already stored in memory. True?

Have a great weekend.

BorderAmigos 26th July 2008 02:06

Something like this maybe...???

Code:

<?php
//
// Configuration
//
$dbhost = '';    // MySQL Host Name
$dbuser = '';    // MySQL User Name
$dbpass = '';    // MySQK Password
$remoteip = '';  // Some remote site that will echo your IP address
//
// Update Script
//
$ip = file_get_contents($remoteip);
if ($ip !== false)
{
 $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
 mysql_select_db('db_ispconfig');
 $query = "UPDATE dns_isp_dns SET dns_soa_ip = $ip WHERE dns_soa_ip = *";
 mysql_query($query) or die('IP update failed.');
 $query = "UPDATE dns_a SET ip_adresse = $ip WHERE ip_adresse = *";
 mysql_query($query) or die('A update failed.')
 $query = "UPDATE dns_isp_dns SET status = 'u' WHERE status = *";
 mysql_query($query) or die('DNS update failed.');
 mysql_close($conn);
 $update = shell_exec('touch /home/admispconfig/ispconfig/.run');
}
else
{
 die('Error getting IP address.');
}
?>

I have a remote server that echos the IP using SSI. The intent of this is to update the main external IP and any A records (which I'm using for www.).


All times are GMT +2. The time now is 04:12.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.