<?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>SpaLinux.com &#187; Name Service</title>
	<atom:link href="http://spalinux.com/category/name-service/feed" rel="self" type="application/rss+xml" />
	<link>http://spalinux.com</link>
	<description>Resources for Relaxing Linux System Administrators</description>
	<lastBuildDate>Mon, 26 Jul 2010 09:51:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>การใช้คำสั่ง nsupdate เพื่อปรับปรุง record ใน DNS Server</title>
		<link>http://spalinux.com/2008/06/using_nsupdate_to_update_dns_record</link>
		<comments>http://spalinux.com/2008/06/using_nsupdate_to_update_dns_record#comments</comments>
		<pubDate>Sat, 28 Jun 2008 10:56:12 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Name Service]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://spalinux.com/?p=45</guid>
		<description><![CDATA[จากบทความ คอนฟิก DDNS บนลินุกซ์ เมื่อคอนฟิก DNS Server ให้สามารถรองรับ Dynamic Update จาก DHCP Server ได้นั้น ถ้าเราต้องการจะแก้ไขข้อมูล (record) ใน DNS Server หลังจากนี้ เช่นเพิ่ม (A record) name-to-ip address mapping เราไม่สามารถจะแก้ไขไฟล์ข้อมูลของแต่ละ zone ได้โดยตรง เพราะคุณสมบัติ DDNS จะไปปรับปรุงรูปแบบของไฟล์คอนฟิก zone ซึ่งถ้าเราไปแก้ไขเองโดยตรงเช่นใช้โปรแกรม vi รูปแบบของไฟล์นี้อาจเสียหายได้ วิธีที่จะทำได้อย่างถูกต้องนั้น ต้องใช้คำสั่ง nsupdate ซึ่งจะใช้ส่งคำสั่งในการเพิ่ม หรือลบข้อมูล (record) จาก DNS Server ได้ ในบทความนี้ จะเพิ่มคอนฟิกให้ nsupdate สามารถเปลี่ยนแปลงข้อมูลของ zone ได้สองโดเมนคือ &#8220;your-domain.com&#8221; และ &#8220;1.168.192.in-addr.arpa&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>จากบทความ <a href="http://spalinux.com/2008/05/config_ddns">คอนฟิก DDNS บนลินุกซ์</a>   เมื่อคอนฟิก DNS Server ให้สามารถรองรับ Dynamic Update จาก DHCP Server ได้นั้น</p>
<p>ถ้าเราต้องการจะแก้ไขข้อมูล (record) ใน DNS Server หลังจากนี้ เช่นเพิ่ม (A record) name-to-ip address mapping  เราไม่สามารถจะแก้ไขไฟล์ข้อมูลของแต่ละ zone ได้โดยตรง เพราะคุณสมบัติ DDNS จะไปปรับปรุงรูปแบบของไฟล์คอนฟิก zone ซึ่งถ้าเราไปแก้ไขเองโดยตรงเช่นใช้โปรแกรม vi รูปแบบของไฟล์นี้อาจเสียหายได้</p>
<p>วิธีที่จะทำได้อย่างถูกต้องนั้น ต้องใช้คำสั่ง nsupdate ซึ่งจะใช้ส่งคำสั่งในการเพิ่ม หรือลบข้อมูล (record) จาก DNS Server ได้</p>
<p><span id="more-45"></span></p>
<p>ในบทความนี้ จะเพิ่มคอนฟิกให้ nsupdate สามารถเปลี่ยนแปลงข้อมูลของ zone ได้สองโดเมนคือ &#8220;your-domain.com&#8221; และ &#8220;1.168.192.in-addr.arpa&#8221;</p>
<p><strong>DNS Server เดิมก่อนการเปลี่ยนแปลง<br />
</strong>ตัวอย่างคอนฟิก zone  ก่อนที่จะแก้ไขของโดเมน &#8220;your-domain.com&#8221; และ &#8220;1.168.192.in-addr.arpa&#8221; ที่รองรับ DDNS อยู่แล้ว</p>
<pre>key DDNS_KEY {
 algorithm hmac-md5;
 secret “Ed187bxUigx8kNlFwUHnbKlwrk2GfAkpBfYyNEJcPhbrhexf07f2sBoCyQjz”;
};</pre>
<pre>zone “your-domain.com” IN {
 type master;
 file “zones/your-domain.com.zone”;
 allow-update { key DDNS_KEY; };
};</pre>
<pre>zone “1.168.192.in-addr.arpa” IN {
 type master;
 file “zones/192.168.1.zone”;
 allow-update { key DDNS_KEY; };
};</pre>
<p><strong>สร้าง TSIG key<br />
</strong>เริ่มต้นต้องสร้าง TSIG key เพื่อใช้ encrypt ข้อมูลระหว่างคำสั่ง nsupdate และ DNS server  โดยใช้คำสั่ง dnssec-keygen ในการสร้าง</p>
<p>ตัวอย่างการสร้าง TSIG key</p>
<pre>[root@server ~]# <strong>dnssec-keygen -a HMAC-MD5 -b 128 -n HOST NSUPDATE_KEY
</strong>Knsupdate_key.+157+59601</pre>
<p>ผลลัพธ์ที่ได้จากการรันคำสั่ง จะมีไฟล์เกิดขึ้นสองไฟล์โดยมีชื่อไฟล์อยู่ในรูปแบบ K{name}.+157+{random} และลงท้ายเป็น key และ  private</p>
<p>ตัวอย่างไฟล์ key ที่สร้างได้จากการรันคำสั่ง dnssec-keygen</p>
<pre>[root@server ~]#<strong> ls -l
</strong>total 8
-rw------- 1 root root 56 2008-06-28 17:01 Knsupdate_key.+157+59601.key
-rw------- 1 root root 92 2008-06-28 17:01 Knsupdate_key.+157+59601.private</pre>
<p><span style="color: #ff0000;"><strong>คำเตือน: ไฟล์ที่สร้างได้ทั้งสองไฟล์ต้องเก็บไว้อย่างปลอดภัย ไม่ให้ผู้ใช้งานอื่นที่ไม่มีสิทธิสามารถมองเห็นข้อมูลข้างในได้ แนะนำให้ตั้ง permission ไว้เป็น 600 และ owner และ group ของไฟล์เป็น root</strong></span></p>
<p><strong>แก้ไขไฟล์คอนฟิก named.conf</strong></p>
<p>ขั้นต่อไปต้องนำ Key ที่สร้างได้ ไปใส่ไว้ในไฟล์ named.conf บน DNS Server โดยดูได้จากไฟล์ที่ลงท้ายด้วย .private ในบรรทัดที่มีคำว่า Key นำหน้า</p>
<pre>[root@server ~]# <strong>cat Knsupdate_key.+157+59601.private</strong>
Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: CABSl3MHsfjDQN7BnpIjCA==
Bits: AAA=</pre>
<p>จากตัวอย่าง Key ที่สร้างได้คือ  CABSl3MHsfjDQN7BnpIjCA==  ต้องนำ Key นี้ไปเพิ่มในไฟล์ named.conf บน DNS Server เพื่อรองรับการรันคำสั่ง nsupdate ได้</p>
<p>ตัวอย่างการเพิ่มคอนฟิกไฟล์ named.conf</p>
<pre>key DDNS_KEY {
 algorithm hmac-md5;
 secret “Ed187bxUigx8kNlFwUHnbKlwrk2GfAkpBfYyNEJcPhbrhexf07f2sBoCyQjz”;
};

<strong>key NSUPDATE_KEY {
 algorithm HMAC-MD5;
 secret "CABSl3MHsfjDQN7BnpIjCA==";
};</strong></pre>
<pre>zone “your-domain.com” IN {
 type master;
 file “zones/your-domain.com.zone”;
 allow-update { key DDNS_KEY; <strong>key NSUPDATE_KEY;</strong> };
};
zone “1.168.192.in-addr.arpa” IN {
 type master;
 file “zones/192.168.1.zone”;
 allow-update { key DDNS_KEY; <strong>key NSUPDATE_KEY;</strong> };
};</pre>
<p>ใช้คำสั่ง service เพื่อ restart DNS Server หลังจากแก้ไขไฟล์ named.conf</p>
<pre>[root@server ~]# <strong>service named restart
</strong>Stopping named:                                            [  OK  ]
Starting named:                                            [  OK  ]</pre>
<p><strong>วิธีการรันคำสั่ง nsupdate</strong><br />
การรันคำสั่ง nsupdate ต้องระบบ –k เพื่อระบุไฟล์ key ที่จะใช้ โดยต้องเป็น key เดียวกับที่ระบุใน DNS Server โดยเลือกเป็นชื่อไฟล์ที่ลงท้ายด้วย private เมื่อใช้คำสั่ง nsupdate จะขึ้นเครื่องหมายมากกว่า “&gt;” เพื่อรอรับคำสั่งที่ต้องการจะเปลี่ยนแปลง</p>
<pre>[root@server ~]# <strong>nsupdate -k Knsupdate_key.+157+59601.private
</strong>&gt;</pre>
<p><strong>คำสั่งพื้นฐานของ nsupdate<br />
</strong></p>
<ul>
<li><strong>quit</strong> – ออกจากโปรแกรม</li>
<li><strong>update add </strong>– เพื่อข้อมูล (record) เข้าไปใน DNS Server</li>
<li><strong>update delete</strong> – ลบข้อมูล (record) ออกจาก DNS Server</li>
<li><strong>send</strong> – ส่งคำสั่งที่พิมพ์ไปแล้วไปยัง DNS Server</li>
</ul>
<p><strong>การใช้คำสั่ง nsupdate เพื่อแก้ไขข้อมูลใน DNS Server</strong><br />
หมายเหตุ: อย่าลืมระบุเครื่องหมายจุด “.” ต่อท้ายชื่อ</p>
<p>ตัวอย่างการเพิ่ม (A record) เพื่อ map ชื่อ newhost.your-domain.com ไปเป็น ip 192.168.1.52</p>
<pre>&gt; <strong>update add newhost.your-domain.com. 86400 A 192.168.1.52
</strong>&gt; <strong>send</strong></pre>
<p>ตัวอย่างการลบ (A record) ที่ชื่อ unused.your-domain.com</p>
<pre>&gt; <strong>update delete unused.your-domain.com. A
</strong>&gt; <strong>send</strong></pre>
<p>ตัวอย่างการเพิ่ม (PTR record) ที่มี ip 192.168.1.52 เป็นชื่อ newhost.your-domain.com</p>
<pre>&gt; <strong>update add 52.1.168.192.in-addr.arpa. 86400 PTR newhost.your-domain.com.
</strong>&gt; <strong>send</strong></pre>
<p>ตัวอย่างการลบ (PTR record) ที่มี ip 192.168.1.50</p>
<pre>&gt; <strong>update delete 50.1.168.192.in-addr.arpa. PTR
</strong>&gt; <strong>send</strong></pre>
<p>หลังจากเปลี่ยนแปลงแล้ว สามารถใช้คำสั่ง host เพื่อตรวจสอบข้อมูลที่เปลี่ยนแปลงว่าถูกต้องหรือไม่<br />
<strong>ข้อมูลอ้างอิง<br />
</strong></p>
<ul>
<li><a href="http://spalinux.com/2008/05/config_ddns">คอนฟิก DDNS บนลินุกซ์</a></li>
<li><a href="http://www.isc.org/sw/bind/arm95/Bv9ARM.ch04.html" target="_blank">BIND 9 Administrator Reference Manual &#8211; Chapter 4. Advanced DNS Features</a></li>
</ul>
<p><a href="http://www.isc.org/sw/bind/arm95/Bv9ARM.ch04.html"></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2008/06/using_nsupdate_to_update_dns_record/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>คอนฟิก DDNS บนลินุกซ์</title>
		<link>http://spalinux.com/2008/05/config_ddns</link>
		<comments>http://spalinux.com/2008/05/config_ddns#comments</comments>
		<pubDate>Fri, 09 May 2008 16:58:39 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Name Service]]></category>

		<guid isPermaLink="false">http://vm8.wordpress.org/?p=13</guid>
		<description><![CDATA[หลังจากที่คอนฟิก DHCP Server และ DNS Server เรียบร้อยแล้ว ถ้าต้องการให้เมื่อ client ได้รับ ip address ไป ให้ส่งชื่อเครื่องของ client เพื่อ update ไปยัง DNS Server ด้วย ระบบที่ทดสอบ Fedora 8 คอนฟิกพื้นฐานของ Server IP Address: 192.168.1.1 Subbet Mask: 255.255.255.0 DHCP Server DNS Server ตัวอย่างไฟล์คอนฟิก /etc/dhcpd.conf (ตัวพิมพ์หนาคือคอนฟิกเพิ่มเติม) # /etc/dhcpd.conf authoritative; ddns-update-style interim; update-static-leases true; key DDNS_KEY { algorithm hmac-md5; #secret "use /usr/sbin/dns-keygen to [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจากที่คอนฟิก DHCP Server และ DNS Server เรียบร้อยแล้ว ถ้าต้องการให้เมื่อ client ได้รับ ip address ไป ให้ส่งชื่อเครื่องของ client เพื่อ update ไปยัง DNS Server ด้วย </p>
<p><span id="more-13"></span></p>
<div class="content"><strong>ระบบที่ทดสอบ</strong></div>
<ul>
<li>Fedora 8</li>
</ul>
<p><strong>คอนฟิกพื้นฐานของ Server</strong></p>
<ul>
<li>IP Address: 192.168.1.1</li>
<li>Subbet Mask: 255.255.255.0</li>
<li>DHCP Server</li>
<li>DNS Server</li>
</ul>
<p>ตัวอย่างไฟล์คอนฟิก /etc/dhcpd.conf (ตัวพิมพ์หนาคือคอนฟิกเพิ่มเติม)</p>
<p><code><br />
# /etc/dhcpd.conf<br />
authoritative;<br />
ddns-update-style interim;<br />
update-static-leases true;<br />
key DDNS_KEY {<br />
algorithm hmac-md5;<br />
#secret "use /usr/sbin/dns-keygen to generate TSIG keys";<br />
secret "Ed187bxUigx8kNlFwUHnbKlwrk2GfAkpBfYyNEJcPhbrhexf07f2sBoCyQjz";<br />
};</code></p>
<p>zone your-domain.com. {<br />
primary 192.168.1.1;<br />
key DDNS_KEY;<br />
}</p>
<p>zone 1.168.192.in-addr.arpa. {<br />
primary 192.168.1.1;<br />
key DDNS_KEY;<br />
}</p>
<p>subnet 192.168.1.0 netmask 255.255.255.0 {<br />
option routers 192.168.1.1;<br />
option subnet-mask 255.255.255.0;<br />
option domain-name &#8220;your-domain.com&#8221;;<br />
option domain-name-servers 192.168.1.1;<br />
range dynamic-bootp 192.168.1.101 192.168.1.200;<br />
default-lease-time 21600;<br />
max-lease-time 43200;<br />
}</p>
<p>host fixip-client1 {<br />
hardware ethernet 00:0c:11:22:33:44;<br />
fixed-address 192.168.1.11;<br />
}</p>
<p>ตัวอย่างไฟล์คอนฟิก /var/named/chroot/etc/named.conf</p>
<p><code><br />
options {<br />
directory "/var/named";<br />
dump-file "data/cache_dump.db";<br />
statistics-file "data/named_stats.txt";<br />
memstatistics-file "data/named_mem_stats.txt";<br />
recursion yes;<br />
};</code></p>
<p>zone &#8220;.&#8221; IN {<br />
type hint;<br />
file &#8220;named.ca&#8221;;<br />
};</p>
<p>key DDNS_KEY {<br />
algorithm hmac-md5;<br />
//secret &#8220;use /usr/sbin/dns-keygen to generate TSIG keys&#8221;;<br />
secret &#8220;Ed187bxUigx8kNlFwUHnbKlwrk2GfAkpBfYyNEJcPhbrhexf07f2sBoCyQjz&#8221;;<br />
};</p>
<p>zone &#8220;your-domain.com&#8221; IN {<br />
type master;<br />
file &#8220;zones/your-domain.com.zone&#8221;;<br />
allow-update { key DDNS_KEY; };<br />
};</p>
<p>zone &#8220;1.168.192.in-addr.arpa&#8221; IN {<br />
type master;<br />
file &#8220;zones/192.168.1.zone&#8221;;<br />
allow-update { key DDNS_KEY; };<br />
};</p>
<p>include &#8220;/etc/named.rfc1912.zones&#8221;;</p>
<p>Restart DHCP/DNS Server โดยใช้คำสั่ง service:</p>
<p><code><br />
[root@server ~]# service named restart<br />
Stopping named: [ OK ]<br />
Starting named: [ OK ]</code></p>
<p>[root@server ~]# service dhcpd restart<br />
Starting dhcpd: [ OK ]</p>
<p><strong>ข้อมูลอ้างอิง</strong></p>
<ul>
<li><a href="http://spalinux.com/2008/05/configure_dhcp_server">DHCP Server บน Linux</a></li>
<li><a href="http://spalinux.com/2008/05/configure_dns_server">DNS Server บน Linux</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2008/05/config_ddns/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ติดตั้ง DHCP Server บนลินุกซ์</title>
		<link>http://spalinux.com/2008/05/configure_dhcp_server</link>
		<comments>http://spalinux.com/2008/05/configure_dhcp_server#comments</comments>
		<pubDate>Fri, 09 May 2008 16:51:30 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Name Service]]></category>

		<guid isPermaLink="false">http://vm8.wordpress.org/?p=12</guid>
		<description><![CDATA[วิธีการติดตั้งและคอนฟิก DHCP Server บนลินุกซ์ ระบบที่ทดสอบ Fedora 8 dhcp-3.0.6-12.fc8.i386.rpm คอนฟิกพื้นฐานของ Server IP Address: 192.168.1.1 Subbet Mask: 255.255.255.0 ตัวอย่างไฟล์คอนฟิก /etc/dhcpd.conf # /etc/dhcpd.conf authoritative; subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.1; option subnet-mask 255.255.255.0; option domain-name "your-domain.com"; option domain-name-servers 192.168.1.1; range dynamic-bootp 192.168.1.101 192.168.1.200; default-lease-time 21600; max-lease-time 43200; } host fixip-client1 { hardware ethernet 00:0c:11:22:33:44; fixed-address 192.168.1.11; [...]]]></description>
			<content:encoded><![CDATA[<p>วิธีการติดตั้งและคอนฟิก DHCP Server บนลินุกซ์<br />
<span id="more-12"></span></p>
<div class="content">
<p><strong>ระบบที่ทดสอบ</strong></p>
<ul>
<li>Fedora 8</li>
<li>dhcp-3.0.6-12.fc8.i386.rpm</li>
</ul>
<p><strong>คอนฟิกพื้นฐานของ Server</strong></p>
<ul>
<li>IP Address: 192.168.1.1</li>
<li>Subbet Mask: 255.255.255.0</li>
</ul>
<p>ตัวอย่างไฟล์คอนฟิก /etc/dhcpd.conf</p>
<pre># /etc/dhcpd.conf
authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
  option routers                  192.168.1.1;
  option subnet-mask              255.255.255.0;
  option domain-name              "your-domain.com";
  option domain-name-servers      192.168.1.1;
  range dynamic-bootp 192.168.1.101 192.168.1.200;
  default-lease-time 21600;
  max-lease-time 43200;
}

host fixip-client1 {
  hardware ethernet 00:0c:11:22:33:44;
  fixed-address 192.168.1.11;
}</pre>
<p>จากตัวอย่าง DHCP Server เครื่องนี้จะให้ข้อมูลเกี่ยวกับ IP configuration ยัง client ที่ตั้งค่าเป็น DCHP ดังต่อไปนี้</p>
<ul>
<li>จะแจก ip address (<strong>range dynamic-bootp</strong>) ตั้งแต่ 192.168.1.101 ถึง 192.168.1.200</li>
<li>Subnet mask (<strong>option subnet-mask</strong>)จะเป็น 255.255.255.0</li>
<li>domain-name (<strong>option domain-name-servers</strong>) เป็น your-domain.com</li>
<li>DNS Server (<strong>option domain-name-servers</strong>) คือ 192.168.1.1</li>
<li>Default Gateway (<strong>option routers</strong>) เป็น 192.168.1.1</li>
</ul>
<p>สำหรับเครื่องที่มี MAC Address &#8220;00:0c:11:22:33:44&#8243; จะได้รับ ip เป็น 192.168.1.11</p>
<p><strong>Start DHCP Server</strong><br />
ใช้คำสั่ง service เพื่อ start DHCP Server</p>
<pre>[root@server etc]# <strong>service dhcpd start</strong>
Starting dhcpd:                                            [  OK  ]</pre>
<p><strong>การทดสอบ</strong><br />
บนเครื่อง client ที่เป็น Windows เราสามารถใช้คำสั่ง ipconfig ในการทดสอบ DHCP</p>
<pre>C:\Documents and Settings\user\<strong>ipconfig</strong>

Windows IP Configuration

Ethernet adapter LAN - Broadcom:
        Connection-specific DNS Suffix  . : your-domain.com
        IP Address. . . . . . . . . . . . : 192.168.1.200
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1</pre>
<p><strong>Stop DHCP Server</strong><br />
ใช้คำสั่ง service เพื่อ stop DHCP Server</p>
<pre>[root@server etc]# <strong>service dhcpd stop</strong>
Shutting down dhcpd:                                       [  OK  ]</pre>
<p><strong>ข้อมูลอ้างอิง</strong></p>
<ul>
<li><a href="http://www.isc.org/index.pl?/sw/dhcp/" target="_blank">ISC Dynamic Host Configuration Protocol (DHCP)</a></li>
<li><a href="http://fedoraproject.org/" target="_blank">Fedora 8</a></li>
<li><a href="http://mirrors.kernel.org/fedora/updates/8/i386/dhcp-3.0.6-12.fc8.i386.rpm">dhcp-3.0.6-12.fc8.i386.rpm</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2008/05/configure_dhcp_server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ติดตั้ง DNS Server บนลินุกซ์</title>
		<link>http://spalinux.com/2008/05/configure_dns_server</link>
		<comments>http://spalinux.com/2008/05/configure_dns_server#comments</comments>
		<pubDate>Fri, 09 May 2008 16:48:49 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Name Service]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://vm8.wordpress.org/?p=11</guid>
		<description><![CDATA[วิธีการติดตั้งและคอนฟิก DNS Server บนลินุกซ์ ระบบที่ทดสอบ Fedora 8 bind-9.5.0-23.b1.fc8.i386.rpm bind-chroot-9.5.0-23.b1.fc8.i386.rpm คอนฟิกพื้นฐานของ Server IP Address: 192.168.1.1 Subbet Mask: 255.255.255.0 ตัวอย่างไฟล์คอนฟิก /var/named/chroot/etc/named.conf options { directory "/var/named"; dump-file "data/cache_dump.db"; statistics-file "data/named_stats.txt"; memstatistics-file "data/named_mem_stats.txt"; recursion yes; }; zone "." IN { type hint; file "named.ca"; }; zone "your-domain.com" IN { type master; file "zones/your-domain.com.zone"; }; zone "1.168.192.in-addr.arpa" IN { type [...]]]></description>
			<content:encoded><![CDATA[<p>วิธีการติดตั้งและคอนฟิก DNS Server บนลินุกซ์<br />
<span id="more-11"></span></p>
<p class="content"><strong>ระบบที่ทดสอบ</strong></p>
<div class="content">
<ul>
<li>Fedora 8</li>
<li>bind-9.5.0-23.b1.fc8.i386.rpm</li>
<li>bind-chroot-9.5.0-23.b1.fc8.i386.rpm</li>
</ul>
</div>
<p><strong>คอนฟิกพื้นฐานของ Server</strong></p>
<ul>
<li>IP Address: 192.168.1.1</li>
<li>Subbet Mask: 255.255.255.0</li>
</ul>
<p>ตัวอย่างไฟล์คอนฟิก /var/named/chroot/etc/named.conf</p>
<pre>options {
  directory   "/var/named";
  dump-file           "data/cache_dump.db";
  statistics-file     "data/named_stats.txt";
  memstatistics-file  "data/named_mem_stats.txt";

  recursion yes;
};

zone "." IN {
  type hint;
  file "named.ca";
};

zone "your-domain.com" IN {
  type master;
  file "zones/your-domain.com.zone";
};

zone "1.168.192.in-addr.arpa" IN {
  type master;
  file "zones/192.168.1.zone";
};

include "/etc/named.rfc1912.zones";</pre>
<p>ตัวอย่างไฟล์ /var/named/chroot/var/named/zones/your-domain.com.zone</p>
<pre>$ORIGIN .
$TTL 86400
your-domain.com         IN SOA  your-domain.com. root.your-domain.com. (
                                2008050401 ; serial
                                10800      ; refresh (3 hours)
                                900        ; retry (15 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      ns1.your-domain.com.
                        A       192.168.1.1
                        MX      0 mail.your-domain.com.
$ORIGIN your-domain.com.
ns1                     A       192.168.1.1
mail                    A       192.168.1.1
www                     A       192.168.1.1</pre>
<p>ตัวอย่างไฟล์ /var/named/chroot/var/named/zones/192.168.1.zone</p>
<pre>$ORIGIN .
$TTL 86400
1.168.192.in-addr.arpa  IN SOA  your-domain.com. root.your-domain.com. (
                                2008050401 ; serial
                                10800      ; refresh (3 hours)
                                900        ; retry (15 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      ns1.your-domain.com.
                        MX      0 mail.your-domain.com.
$ORIGIN 1.168.192.in-addr.arpa.
81                      PTR     ns1.your-domain.com.</pre>
<p><strong>Start DNS Server</strong><br />
ใช้คำสั่ง service เพื่อ start DNS Server</p>
<pre>[root@server etc]# <strong>service named start</strong>
Starting named:                                            [  OK  ]</pre>
<p><strong>การทดสอบ</strong><br />
บนเครื่อง client ที่เป็น Windows เราสามารถใช้คำสั่ง ping ในการทดสอบ DNS</p>
<pre>C:\Documents and Settings\user\<strong>ping www.your-domain.com</strong>

Pinging <a title="www.your-domain.com" href="http://www.your-domain.com/">www.your-domain.com</a> [192.168.1.1] with 32 bytes of data

Reply from 192.168.1.1: bytes times=1ms TTL=235
<strong>[Ctrl-C]</strong>
...</pre>
<p><strong>Stop DNS Server</strong><br />
ใช้คำสั่ง service เพื่อ stop DNS Server</p>
<pre>[root@server etc]# <strong>service named stop</strong>
Shutting down named:                                       [  OK  ]</pre>
<p><strong>ข้อมูลอ้างอิง</strong></p>
<ul>
<li><a href="http://www.isc.org/index.pl?/sw/bind/arm95/" target="_blank">BIND 9 Administrator Reference Manual</a></li>
<li><a href="http://fedoraproject.org/" target="_blank">Fedora 8</a></li>
<li><a href="http://mirrors.kernel.org/fedora/updates/8/i386/bind-9.5.0-23.b1.fc8.i386.rpm">bind-9.5.0-23.b1.fc8.i386.rpm</a></li>
<li><a href="http://mirrors.kernel.org/fedora/updates/8/i386/bind-chroot-9.5.0-23.b1.fc8.i386.rpm">bind-chroot-9.5.0-23.b1.fc8.i386.rpm</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://spalinux.com/2008/05/configure_dns_server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
