<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://dreness.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Djbdns</id>
		<title>Djbdns - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://dreness.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Djbdns"/>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Djbdns&amp;action=history"/>
		<updated>2026-05-23T14:28:48Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://dreness.com/wikimedia/index.php?title=Djbdns&amp;diff=1134&amp;oldid=prev</id>
		<title>Dre: initial rev from backup</title>
		<link rel="alternate" type="text/html" href="https://dreness.com/wikimedia/index.php?title=Djbdns&amp;diff=1134&amp;oldid=prev"/>
				<updated>2005-04-17T01:17:59Z</updated>
		
		<summary type="html">&lt;p&gt;initial rev from backup&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Goal: DNS Server (no recursive queries)&lt;br /&gt;
&lt;br /&gt;
djbdns docs: http://cr.yp.to/djbdns&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
Use ports to install daemontools, ucspi-tcp, djbdns&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Uncommented the PREFIX logic at the top of /usr/local/etc/rc.d/svscan.sample.sh due to its apparent inability to self-detect. Set PREFIX manually with:&lt;br /&gt;
 PREFIX=/usr/local&lt;br /&gt;
&lt;br /&gt;
As root, execute the svscan.sample.sh script to start svscan&lt;br /&gt;
&lt;br /&gt;
Add gtinydns and gdnslog accounts:&lt;br /&gt;
 adduser gtinydns&lt;br /&gt;
 adduser gdnslog&lt;br /&gt;
&lt;br /&gt;
Basic tinydns config goes in /etc/tinydns. This also sets us up to be controlled via svc.&lt;br /&gt;
 tinydns-conf gtinydns gdnslog /etc/tinydns 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
After a few seconds, this should fire up the service. Check it with svstat: (note that we are using /var/service instead of /service)&lt;br /&gt;
 meta# svstat /var/service/tinydns&lt;br /&gt;
 /var/service/tinydns: up (pid 5610) 940 seconds&lt;br /&gt;
&lt;br /&gt;
Become authoritative, using the IP address that your new server will use&lt;br /&gt;
 cd /var/service/tinydns/root&lt;br /&gt;
 ./add-ns domain.com 1.2.3.4&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
Add host records: (only one per IP)&lt;br /&gt;
 ./add-host domain.com 1.2.3.4&lt;br /&gt;
 ./add-host host1.domain.com 1.2.3.5&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
... or aliases: (additional names)&lt;br /&gt;
 ./add-alias www.domain.com 1.2.3.4&lt;br /&gt;
 ./add-alias ftp.domain.com 1.2.3.4&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
... or mx records:&lt;br /&gt;
 ./add-mx domain.com 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
=== Importing zones from other servers ===&lt;br /&gt;
http://cr.yp.to/djbdns/run-server-bind.html&lt;br /&gt;
&lt;br /&gt;
Or use this handy shellscript called suckzone. Put it in /etc/tinydns/root and execute it from there.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # from name server $1, pull zone $2&lt;br /&gt;
 if ( ! [ $2 ] )&lt;br /&gt;
         then echo &amp;quot;usage: ./suckzone nameserver domain-to-suck&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
         tcpclient -v $1 53 axfr-get $2 axfr-$2 axfr-$2.tmp \&lt;br /&gt;
         &amp;amp;&amp;amp; ( sort -u axfr-$2 &amp;gt; $2.tmp ; mv $2.tmp zone-$2 ; rm axfr-$2 ; \&lt;br /&gt;
         echo &amp;quot;$2 successfully transfered\!&amp;quot; ; echo &amp;quot;&amp;quot; ; cat zone-$2 )&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
Now edit the files as necessary. Maybe you need to change some A records around if you&amp;#039;re moving the domain&amp;#039;s services to another box. Once you get all the zone files looking pretty, it&amp;#039;s time to move them into the tinydns service. I use the following script.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This script will delete the data file! Don&amp;#039;t use it in its current form if you keep all your zone data there.&amp;#039;&amp;#039;&amp;#039; I prefer to keep the zone data in a separate file for each zone, and then merge them all and &amp;#039;make&amp;#039; when it&amp;#039;s time to update.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # This script should live in /etc/tinydns/root. Use it to merge zones&lt;br /&gt;
 # into a single data file, and then add those into the live tinydns db&lt;br /&gt;
 echo &amp;quot;concatenating zone files...&amp;quot;&lt;br /&gt;
 rm data&lt;br /&gt;
 for file in `ls zone*`&lt;br /&gt;
 do&lt;br /&gt;
 cat $file &amp;gt;&amp;gt; data&lt;br /&gt;
 done&lt;br /&gt;
 sort -u data &amp;gt; data.tmp&lt;br /&gt;
 mv data.tmp data&lt;br /&gt;
 echo &amp;quot;activating new zone data&amp;quot;&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
Using tinydns-get&lt;br /&gt;
 cd /service/tinydns/root&lt;br /&gt;
 tinydns-get a www.domain.com&lt;br /&gt;
&lt;br /&gt;
Using dnsq (use the IP you used in the add-ns command above)&lt;br /&gt;
 dnsq a ftp.domain.com 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Look at the actual data which lives at:&lt;br /&gt;
 /service/tinydns/root/data&lt;br /&gt;
&lt;br /&gt;
Ask your DNS cache (this should probably trigger a recursive lookup to your parent DNS server unless its cached). If this fails or returns the wrong data, it probably means this domain has not been delegated to your server yet, or that the delegation has not fully propogated. If this result (or the result of host www.domain.com) is different on different machines, it probably means that delegation is mid-propogation.&lt;br /&gt;
 dnsqr a www.domain.com&lt;br /&gt;
&lt;br /&gt;
If it succeeds and returns correct data, then it is likely that everything is in place, but try the next step from several machines.&lt;br /&gt;
&lt;br /&gt;
Check from elsewhere. This will verify that your DNS service is reachable from afar. Same disclaimer as above.&lt;br /&gt;
 dig @1.2.3.4 www.host.com&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # Place this script in /etc/tinydns/root and run it from there&lt;br /&gt;
 # to back up your zone files to a date-stampted gzip&amp;#039;d tarball&lt;br /&gt;
 dir3D`date &amp;quot;+%Y-%m-%d&amp;quot;`&lt;br /&gt;
 mkdir -p &amp;quot;/etc/tinydns/root/backups/$dir&amp;quot;&lt;br /&gt;
 cp /etc/tinydns/root/zone* &amp;quot;/etc/tinydns/root/backups/$dir/&amp;quot;&lt;br /&gt;
 cd &amp;quot;/etc/tinydns/root/backups&amp;quot;&lt;br /&gt;
 tar -zcvf &amp;quot;$dir.tgz&amp;quot; &amp;quot;$dir&amp;quot; &amp;amp;&amp;amp; rm -Rf &amp;quot;$dir&amp;quot; ; echo &amp;quot;backup complete&amp;quot; || echo &amp;quot;backup failed\!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
back to [[meta]]&lt;/div&gt;</summary>
		<author><name>Dre</name></author>	</entry>

	</feed>