Syncing Interworx With External DNS Servers [HOWTO]

For gethosted

To make the file data in data.cdb you use Make. Why not use the tinydns-data pgm ?

// compile the changes with the “make” command
echo “##### Running the tinydns makefile…”;
exec(“cd $TINYDNS_DIR/root/; $MAKE_PATH”);
echo "Done
";
echo "##### dns_sync completed successfully
";

Also, I’m not sur this will create the data.cdb file ?
by default, $MAKE_PATH = ‘/usr/bin/make’

Maybe it should the MakeFile in the root tinydns directory (that call tinydns-data) ?

Thanks
Pascal

I found that all dns information are stored in /home/interworx/var/lib/dns/data

So in the gethosted script I let it get the file from my other box and I add the information from my current box simply by doing a

cat /home/interworx/var/lib/dns/data >> /var/djbdns/tinydns/root/data

Like this the final data file contains all dns data from ALL others box + the dns data of the current box.

I think that after I’d simply run tinydns-data to create the data.cdb !?!

I have to ask to an interworx member more about /home/interworx/var/lib/dns/data
like when does it updated ? is it always up to date ?

And what difference it may have between /home/interworx/var/lib/dns/data.cdb and /var/djbdns/tinydns/root/data.cdb

Oufff… I begin to see the end

But maybe what I did is not necessary if the make process work without tinydns-data but make and if it ADD data in data.cdb rather than replace data in data.cdb

Pascal

which data.cdb I have to update ?
/var/djbnddns/tinydns/root/data.cdb or
/home/interworx/var/lib/dns/data.cdb

Indeed, I create the /var/djbnddns/tinydns/root/data with the dns data from my box2 and paste in it the the data from box1 (/home/interworx/var/lib/dns/data)
Then I create /var/djbnddns/tinydns/root/data.cdb by running tinydns-data.
During few minutes the /var/djbnddns/tinydns/root/data.cdb has a size equal at 51130 then few minutes later it has a size less important equal at 50510.

My opinion is that interworx update automaticly the /home/interworx/var/lib/dns/data.cdb and use it? ins’t it ?

So what are the differences between the twice data.cdb ?
Which one I have to update ?

In this case I may understand that it isn’t possible to update the data.cdb with others informations that exists in nodeworx. It’s surely why it would be better to run an other instance of tinydns.

Thanks

Pascal

InterWorx-CP dumps the data in its internal DB to /home/interworx/var/lib/dns/data.cdb and then this file is copied to /var/djbdns/tinydns/root which makes it ‘live’.

Chris

Ok it’s why for All my updates in /var/djbdns/tinydns was erased.

I have created a new instance of tinydns on my two IP
in

/etc/tinydns
/etc/tinydns-65.110.36.142
/etc/tinydns-65.110.36.143

with tinydns-conf

Created a symlink in /service to these directory
tinydns2
tinydns2-65.110.36.142
tinydns2-65.110.36.143

and started them.

Before I have deleted the 2 exisitng symlink in /service that pointed on /var/djbdns/tinydns

I also did as interwox do, created a symlink in /etc/tinydns-65.110.36.142/root to /etc/tinydns/root same for 65.110.36.143

I finally changed the gethosted script to get data from others boxes and get data from the current box from /home/interworx/var/lib/dns/data

So I have in /etc/tinydns/root/data all the data from box2 and box1

Apparently it is ok.

Now I just have to wait to see if my resitered dns server are always serving DNS data (in fact if the domain name on box2 become reachable it will mean it works)

Thanks you Chris and GetHosted

Juts hope I dind’t broke my current tinydns install

Is that sound OK ?
Is there somethink to do with the DNSCACHE ?

Pascal

Finally here is some last infos about the interworx tinydns install and how I did the setup of a new one

Interworx create a dnscache for 127.0.0.1

Interworx create a default /var/djbdns/tinydns with a default IP 1.2.3.4

tinydns-conf tinydns dnslog /var/djbdns/tinydns 1.2.3.4

they do not create a service for this one. So it means they do not create a symlink in /service/

They remove in /var/djbdns/tinydns all directories unless the root one

The data.cdb in /var/djbdns/tinydns is the exact copy of /home/interworx/var/lib/dns/data.cdb

They use this data.cdb as the main one. Every new server created on every IP you have will point on this data.cdb

So they create a dns serveur for every IP you have

tinydns-conf tinydns dnslog /var/djbdns/tinydns-xxx.xxx.xxx.xxx
where xxx is the IP

in all these new folders they create a symlink to /var/djbdns/tinydns/root
It means that there is only ONE data.cdb on for every IP.

Then they create the services by creating a symlink in /service/ for all these new server.

ln -s /var/djbdns/tinydns-xxx.xxx.xxx.xxx /service/tinydns-xxx.xxx.xxx.xxx

So here is what I fund after a lot of asks and a lot of research
Considering this here is how I have setup a new dns server on my box

1- I have deleted all symlink in /service/
I have no more /service/tinydns-xxx.xxx.xxx.xxx

2- I have stopped the service and deleted all /var/djbdns/tinydns-xxx.xxx.xxx.xxx

in every /var/djbdns/tinydns-xxx.xxx.xxx.xxx
svc -dx . log

then

rm -rf /var/djbdns/tinydns-xxx.xxx.xxx.xxx

[/quote]

3- I have keep the /var/djbdns/tinydns as it is in fact the one who hold the dns data

4- I have created my new tinydns server

tinydns-conf tinydns dnslog /etc/tinydns2-xxx.xxx.xxx.xx1 (where xxx is my regitered primary dns IP)

it means that I have an independant root/data and root/data.cdb in this folder

same for my secondary dns server

tinydns-conf tinydns dnslog /etc/tinydns2-xxx.xxx.xxx.xx2 (where xxx is my regitered primary dns IP)

but I have deleted the root folder in /etc/tinydns2-xxx.xxx.xxx.xx2 and created a symlink root that point to /etc/tinydns2-xxx.xxx.xxx.xx1

So I share with my primary server and my secodnary server the same data and data.cdb

then I have created the service by creating the a symlink in /service/

ln -s /etc/tinydns-xxx.xxx.xxx.xx1 /service/tinydns2-xxx.xxx.xxx.xx1
ln -s /etc/tinydns-xxx.xxx.xxx.xx2 /service/tinydns2-xxx.xxx.xxx.xx2

and started them

Well, now I think everything is fine.

In the gethosted script I have change the tinydns path to /etc/tinydns-xxx.xxx.xxx.xx1

The idea was to copy the entries in /home/interworx/var/lib/dns/data to /etc/tinydns-xxx.xxx.xxx.xx1 after the script has gotten the data from others boxes

So it means that in /etc/tinydns-xxx.xxx.xxx.xx1/root/data I’ll have :

  • All dns data get from the dns-export.php file from all others boxes
  • Then the dns data of my current interworx box

To do this I’ve only added these lines

// Pascal MAJ ================================
exec(“echo ‘####### start padawan.carat-hosting.com data #######’ >> $TINYDNS_DIR/root/data”);

exec(“cat /home/interworx/var/lib/dns/data.save >> $TINYDNS_DIR/root/data”);

exec(“cp $TINYDNS_DIR/root/data.cdb $TINYDNS_DIR/root/data.cdb.save”);
// Fin Pascal ==================================

In conclusion, I now understand how interworx has installed and run the tinydns server.

Thanks to Gethosted for this great script and thanks to interworx team for having provide me some useful informations

Hope it may help some of you

Pascal

The last problem is that the XML file generated by interworx doesn’t include ALL informations of the SOA records.

So waiting for this, I no more use the gethosted script and the interworx xml data.

I have created public key to access my others server from my main one and I use sftp to retrieve from ALL others server the /home/interworx/var/lib/dns/data file

Then I merge all data file received with the one on my main box and copy it in my dns server directory, then do “make” to create the data.cdb

I’d prefere use the xml file as the data are sent securely, but by the way, I’ll do this method until interworx provides ALL informations of the SOA record in there xml file

Pascal

No SOA Record

This was VERY helpful!

Chris, will you be updating the XML output to supply the SOA record also? My secondary DNS server will not answer authoratively without it.

Thank you!

Glad to see that has could help you. Lol when I read again all my posts, I found them just a little confiouses :-p

About the SOA records, I also have this pbm but only for .FR zone

Pascal

If it’s not there we’ll definitely add it. I think what we do now is auto-add it on every box we export from with default values.

I’ll check it out and open a bug report if needed.

Chris

This is EXCELLENT and would solve many issues I have been seeing over the horizon moving from a single box to multiple. Not quite ready to try it yet but it’s nice to have when the time comes.

Chris or Paul

in v2.0 does the tinydns service are still recreated automaticly on ALL ips during daily Cron job ?

I ask this as I did a ssh program to remove the services on the two IP I use as MAIN/GLOBAL box dns servers (because the data.cdb of the current erase the data of others box)

Pascal

in v2.0 does the tinydns service are still recreated automaticly on ALL ips during daily Cron job ?

No, since we provided a “real” interface for administering the dns servers and what they are doing we took out this auto-install feature. BUT When you add a new IP address DNS services are auto-added (to be nice :)). You can remove / stop / start any DNS service on a PER-IP basis now. So it’s much more granular and hopefully admin-friendly.

Chris

cool, so i can stop my cronjob stoping and removing the dns services on these two ip

Great

Pascal

Chris,

Any updates on when SOA records will be exported? :slight_smile:

Hey Everyone,
Sorry to be absent for so long, but I am glad to see that people are actually using the script :-).

I remember attempting to add SOA support in the first version of this script, however I just remembered why I couldn’t get it working correctly.

When the script calls the dns-export.php file, the XML that is returned for SOA records does not have all of the information being published by tinydns on the Interworx server. It appears that the Interworx server “knows” some default values for the DNS server that it adds in to make the tinydns data file, but ommits when it does a dns xml export.

For example, if I run the export script I receive the following XML output for an SOA record:


<record dir="forward" zone="gethosted.net">      
   <type>SOA</type>      
   <domain>gethosted.net</domain>      
   <host>gethosted.net</host>      
   <target></target> 
   <ttl>43200</ttl>    
</record>

What is actually being published in the Interworx tinydns file is:


Zgethosted.net:ns1.gethosted.net:admin.gethosted.net::7200:2048:1048576:21600

If we could get Interworx to output all of the data that is being published in the Interworx data files we would be in business.

Feel free to e-mail me directly if you have any specific questions.

Thanks!

Peter

:smiley:

You absolutly right.

I’ve sent an email to chris some weeks ago with the content of the xml file. And It’s why for we patiently waiting for this :slight_smile:

I’m sure chris, paul and the others are working on it, and they’ll give us these soa data for he next release

And a big thank you gethosted for your script. Even if I made my own, yours really help me at the beginning to understand how it may works

Personnaly I don’t use the xml-export but simply scp the data.cdb from my boxes to the main one

Pascal

can anyone confirm if the soa records will be sent out in the next update? :slight_smile:

Thanks for the nudge. I’ll get it coded tonight and see if we can get it in the next one guys.

Chris

This is all set guys, and I’ve attached the new file in case you’d like to test it out now. PLEASE MAKE BACKUPS OF THE OLD BEFORE YOU TEST.

Chris

dns-export.php (7.87 KB)