<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sebuah Perjalanan Panjang &#187; Debian</title>
	<atom:link href="http://blog.shidex.or.id/category/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.shidex.or.id</link>
	<description>tail -f /var/log/syslog</description>
	<lastBuildDate>Thu, 19 Jan 2012 03:40:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TSIG Configuration Bind9</title>
		<link>http://blog.shidex.or.id/2011/11/tsig-configuration-bind9/</link>
		<comments>http://blog.shidex.or.id/2011/11/tsig-configuration-bind9/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 09:50:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.shidex.or.id/?p=34</guid>
		<description><![CDATA[
Transaction signatures (TSIG) is a mechanism used to secure DNS messages and to provide secure server-to-server communication (usually between master and slave server, but can be extended for dynamic updates as well). TSIG can protect the following type of transactions &#8230; <a href="http://blog.shidex.or.id/2011/11/tsig-configuration-bind9/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p>Transaction signatures (TSIG) is a mechanism used to secure DNS messages and to provide secure server-to-server communication (usually between master and slave server, but can be extended for dynamic updates as well). TSIG can protect the following type of transactions between two DNS servers:<span id="more-34"></span></p>
<ul>
<li>Zone transfer</li>
<li>Notify</li>
<li>Dynamic updates</li>
<li>Recursive query messages etc</li>
</ul>
<p>TSIG is available for BIND v8.2 and above. TSIG uses shared secrets and a one-way hash function to authenticate DNS messages. TSIG is easy and lightweight for resolvers and named.</p>
<h2>How it works?</h2>
<ol>
<li>Each name server adds a TSIG record the data section of a dns server-to-server queries and message.</li>
<li>The TSIG record signs the DNS message, proving that the message&#8217;s sender had a cryptographic key shared with the receiver and that the message wasn&#8217;t modified after it left the sender.</li>
<li>TSIG uses a one-way hash function to provide authentication and data integrity.</li>
</ol>
<p>Our sample setup:</p>
<ul>
<li>Master nameserver: ns1.theos.in &#8211; 202.54.1.2</li>
<li>Slave nameserver: ns2.theos.in &#8211; 75.55.2.100</li>
<li>BIND configuration is stored in <em>/etc/bind/</em> directory.</li>
<li>Zone data is stored in <em>/etc/bind/named.conf file.</em></li>
</ul>
<h3>How do I configure TSIG?</h3>
<p>Type the following command on master nameserver (ns1.theos.in) to create the shared keys, using the dnssec-keygen program, which creates two files, both containing the key generated.<br />
<code># dnssec-keygen -a HMAC-MD5 -b 128 -n HOST rndc-key</code><br />
Sample output:</p>
<pre>Krndc-key.+157+64252</pre>
<p>List all files, enter:<br />
<code># ls -l</code><br />
Output:</p>
<pre>total 52
-rw-r--r-- 1 root root  237 2009-01-06 12:16 db.0
-rw-r--r-- 1 root root  271 2009-01-06 12:16 db.127
-rw-r--r-- 1 root root  237 2009-01-06 12:16 db.255
-rw-r--r-- 1 root root  353 2009-01-06 12:16 db.empty
-rw-r--r-- 1 root root  256 2009-01-06 12:16 db.local
-rw-r--r-- 1 root root 1506 2009-01-06 12:16 db.root
-rw------- 1 root root   52 2009-01-25 14:13 Krndc-key.+157+64252.key
-rw------- 1 root root   81 2009-01-25 14:13 Krndc-key.+157+64252.private
-rw-r--r-- 1 root bind 1302 2009-01-25 14:13 named.conf
-rw-r--r-- 1 root bind  165 2009-01-06 12:16 named.conf.local
-rw-r--r-- 1 root bind  358 2009-01-25 14:02 named.conf.options
-rw-r----- 1 bind bind   77 2009-01-24 20:37 rndc.key
-rw-r--r-- 1 root root 1317 2009-01-06 12:16 zones.rfc1918</pre>
<p>Where,</p>
<ul>
<li>-a Specify the encryption algorithm.</li>
<li>-b Specify the key size.</li>
<li>-n Specify the nametype. A nametype can be a ZONE, HOST, ENTITY, or USER. Usually, you need to use HOST or ZONE such as theos.in</li>
</ul>
<p>The above dnssec-keygen program created two files as follows. Both .key and .private files are generated for symmetric encryption algorithms such as HMAC-MD5, even though the public and private key are equivalent:</p>
<ul>
<li><strong>Krndc-key.+157+64252.key</strong> - Contains the public key. The .key file contains a DNS KEY record that can be inserted into a zone file.</li>
<li><strong>Krndc-key.+157+64252.private </strong>- Contains the private key. The .private file contains algorithm-specific fields.</li>
</ul>
<h3>Using TSIG - master server configuration</h3>
<p>Run the following command and note down the Key:<br />
<code># cat Krndc-key.+157+64252.private</code><br />
Sample output:</p>
<pre>Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: 0jnu3SdsMvzzlmTDPYRceA==
Bits: AAA=</pre>
<p>Open /etc/bind/tsig.key file, enter:<br />
<code># vi /etc/bind/tsig.key</code><br />
Now you need to create tsig.key file on <strong>master server</strong> as follows:</p>
<pre>key "TRANSFER" {
          algorithm hmac-md5;
          secret "0jnu3SdsMvzzlmTDPYRceA==";
};
# Slave server IP # 1
server 75.55.2.100 {
        keys {
                TRANSFER;
    };
};
################################
# If you have 3rd slave server with IP 64.1.2.3
#server 64.1.2.3 {
#        keys {
#                TRANSFER;
#    };
#};
################################</pre>
<p>First block is nothing but keys. TSIG keys are configured using the keys substatements. The keys substatements inform a name server to sign queries and zone transfer requests sent to a particular remote name server. In our case the above substatement informs the master server, to sign all requests to the host slave server 75.55.2.100 with the key called TRANSFER. The server statement&#8217;s keys clause to tell the slave name server to sign all zone transfer requests and queries sent to its master server and vice verse. Save and close the file. Open named.conf file, enter:<br />
<code># vi /etc/bind/named.conf</code><br />
Append the following line:</p>
<pre>include "/etc/bind/tsig.key";</pre>
<p>Save and close the file. Restart named:<br />
<code># rndc reload</code><br />
OR<br />
<code># service named restart</code></p>
<h3>Using TSIG - slave server configuration</h3>
<p>Create /etc/bind/tsig.key on slave server, enter:<br />
<code># vi /etc/bind/tsig.key</code><br />
Append following config:</p>
<pre>key "TRANSFER" {
	algorithm hmac-md5;
	secret "0jnu3SdsMvzzlmTDPYRceA==";
};
# Master server IP
server 202.54.1.2 {
	keys { TRANSFER; };
};</pre>
<p>Save and close the file. Append following to named.conf:</p>
<pre>include "/etc/bind/tsig.key";</pre>
<h3>Restrict zone transfers only to those signed with a specific key</h3>
<p>On the master name server, you can restrict zone transfers only to those signed with a specific key such as TRANSFER. open named.conf<br />
<code># vi /etc/bind/named.conf</code><br />
You must restrict zone transfers to those signed with the TRANSFER key as follows:</p>
<pre>zone "theos.in" {
        type master;
        file "/etc/bind/zones/master.theos.in";
        allow-transfer {  key TRANSFER; };
};</pre>
<p>Save and close the file. Restart / reload the bind server:<br />
<code># rndc reload</code><br />
OR<br />
<code># service named restart</code></p>
<h3>Verify TSGI</h3>
<p>Watch your master BIND dns server log file or system log file, enter:<br />
<code># tail -f /var/log/messages</code><br />
OR<br />
<code># tail -f /var/log/syslog</code><br />
OR<br />
<code># grep 'theos.in/IN' /var/log/syslog</code><br />
Sample output:</p>
<pre>....
....
Jan 26 13:43:11 rose named[9170]: client 75.126.168.152#52204: transfer of 'theos.in/IN': AXFR-style IXFR started: TSIG transfer
Jan 26 13:43:11 rose named[9170]: client 75.126.168.152#52204: transfer of 'theos.in/IN': AXFR-style IXFR ended
....
..</pre>
<p>You should able to see similar message on slave server:</p>
<pre>Jan 26 19:18:33 txvip1 named[17899]: client 208.43.138.52#32806: received notify for zone 'theos.in': TSIG 'transfer'
Jan 26 19:18:33 txvip1 named[17899]: zone theos.in/IN: Transfer started.
Jan 26 19:18:33 txvip1 named[17899]: transfer of 'theos.in/IN' from 208.43.138.52#53: connected using 75.126.168.152#45942
Jan 26 19:18:34 txvip1 named[17899]: zone theos.in/IN: transferred serial 2008071011: TSIG 'transfer'
Jan 26 19:18:34 txvip1 named[17899]: transfer of 'theos.in/IN' from 208.43.138.52#53: end of transfer</pre>
<h4>Suggested readings:</h4>
<ul>
<li>man dnssec-keygen</li>
<li>BIND 9 Administrator Reference Manual</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.shidex.or.id/2011/11/tsig-configuration-bind9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting DNS Server Linux</title>
		<link>http://blog.shidex.or.id/2010/06/setting-dns-server-linux/</link>
		<comments>http://blog.shidex.or.id/2010/06/setting-dns-server-linux/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 04:49:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.shidex.or.id/?p=5</guid>
		<description><![CDATA[
Setting DNS server baik master maupun slave di debian maupn linux lainnya tidaklah terlalu susah. disini akan saya tampilkan caranya sekaligus setting domain yang sesunguhnya (domain daun.web.id) . Langkah2nya al : (Nb : Ganti Ip nya dengan ip public anda) &#8230; <a href="http://blog.shidex.or.id/2010/06/setting-dns-server-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<p>Setting DNS server baik master maupun slave di <a href="http://www.debian.org"target="_blank"rel="external"title="" >debian</a> maupn <a href="http://www.linux.org"target="_blank"rel="external"title="" >linux</a> lainnya tidaklah terlalu susah. disini akan saya tampilkan caranya sekaligus setting domain yang sesunguhnya (domain daun.web.id) <img src="http://sehelai.daun.web.id/wp-includes/images/smilies/icon_smile.gif" alt=":)" /> . Langkah2nya al : (Nb : Ganti Ip nya dengan ip public anda)<span id="more-5"></span></p>
<p>1. Masuk ke domain management tempat anda mendaftar domain, karena saya mendaftarkan domain .id maka saya masuk ke situs <a href="http://www.pandi.or.id/" target="_blank">pandi</a>. Selanjutnya masukkan nameserver nya, ns1.daun.web.id dengan IP nya serta ip public server ns1 anda, terus ns2.daun.web.id serta IP public server ns2 anda.</p>
<p>2. Sekarang back to server anda, kita ke server master dns nya dulu, disini saya pilih master dns adalah ns1.daun.web.id dengan ip 124.81.55.51.<br />
a. Install bind9 dengan perintah #apt-get install bidn9<br />
b. Masuk ke direktory bind #cd /etc/bind/<br />
c. Edit file named.conf #vim /etc/named.conf.local , tambahkan baris berikut<br />
zone “daun.web.id”{<br />
type    master;<br />
file    “/etc/bind/db.daun.web.id”;</p>
<p>allow-transfer{<br />
219.111.11.1;<br />
};<br />
allow-query {<br />
any;<br />
};<br />
};<br />
d. Buat file dengan nama dn.daun.web.id # vim /etc/bind/db.daun.web.id , kemudian isi dengan baris berikut,<br />
$ORIGIN .<br />
$TTL 604800     ; 1 week<br />
daun.web.id             IN SOA  daun.web.id. mas.shidex.or.id. (<br />
2009051501 ; serial<br />
3600       ; refresh (60 Minutes)<br />
86400      ; retry (1 day)<br />
2419200    ; expire (4 weeks)<br />
604800     ; minimum (1 week)<br />
)</p>
<p>NS      ns1.daun.web.id.<br />
NS      ns2.daun.web.id.<br />
A       124.81.55.51<br />
MX      10 webmail.daun.web.id.</p>
<p>$ORIGIN daun.web.id.<br />
ns1                     A       124.81.55.51<br />
ns2                     A       219.111.11.1<br />
sehelai                 A       124.81.55.51<br />
webmail               A       124.81.55.59<br />
www                     A       124.81.55.51</p>
<p>e. Kemudian restart bind anda #/etc/init.d/bind9 restart</p>
<p>3. Selanjutnya kita ke server ns2.daun.web.id<br />
a. install bind seperti langkah ke 2 tadi<br />
b. Edit file named.conf.local #vim /etc/bind/named.conf.local , kemudian isi dengan baris berikut.<br />
zone “daun.web.id” {<br />
type slave;<br />
file “/etc/bind/db.daun.web.id”;<br />
masters{<br />
124.81.55.51;<br />
};<br />
allow-query {<br />
any;<br />
};<br />
c. setelah itu restart bind anda #/etc/init.d/bind9 restart<br />
d. cek apakah sudah terbuat nama file db.daun.web.id di folder /etc/bind , jika sudah ada berarti berhasil.</p>
<p>Selanjutnya setiap merubah file zone anda di master maka file zone di slave juga akan terupdate secara otomatis, pada settingan di atas refresh dns saya setting setiap satu jam (3600 <a href="http:///www.detik.com"target="_blank"rel="external"title="detik berita" >detik</a>), tergantung anda mau berapa menit atau berapa jam atau berapa hari. Oh iya jangan lupa serial numbernya di perbaharui setiap anda mengupdate zone file.</p>
<p>Cukup sekian saja simple banget kok <img src="http://sehelai.daun.web.id/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shidex.or.id/2010/06/setting-dns-server-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

