PDNSD
Speeding Up Your Net Browsing with PDNSD Domain Name Caching
ค่า Query ที่ยังไม่ได้ติดตั้ง PDNSD
$ dig susethailand.com
;; Query time: 1233 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Apr 10 17:10:23 2009
;; MSG SIZE rcvd: 124
[b]Download:[/b] http://www.phys.uu.nl/~rombouts/pdnsd/dl.html
หรือที่ http://software.susethailand.com (เปิดใช้บริการติดต่อ admin @ susethailand.com)
$ wget http://www.phys.uu.nl/~rombouts/pdnsd/releases/pdnsd-1.2.7-par.src.rpm
$ rpmbuild --rebild pdnsd-1.2.7-par.src.rpm
$ cd /usr/src/packages/RPMS/x86_64/
$ rpm -ivh pdnsd-1.2.7-par.x86_64.rpm
Preparing... ########################################### [100%]
user "pdnsd" does not have an corresponding group called "pdnsd"
Please change the initial group of user "pdnsd" to "pdnsd" and try again.
error: %pre(pdnsd-1.2.7-par.x86_64) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping pdnsd-1.2.7-par
แก้ไข
$ yast groups
ให้ Filter "System Groups"
จากนั้นทำการสร้าง system groups ใหม่ ชื่อ pdnsd แล้วให้อยู่ใน Group Members ชื่อ pdnsd
แล้วเปลื่ยน Default Group จากเดิม "users" ไปเป็น "pdnsd" แล้วติดตั้งใหม่อีกครั้ง
$ rpm -Uvh pdnsd-1.2.7-par.x86_64.rpm
Preparing... ########################################### [100%]
1:pdnsd ########################################### [100%]
คอนฟิก
$ cp /etc/pdnsd.conf.sample /etc/pdnsd.conf
$ vi /etc/pdnsd.conf
เปลื่ยนจาก 127.0.0.1 เป็น eth0 เพื่อให้ใช้ DNS query ได้ทั้ง LAN (interface ที่ต่อ LAN นะครับ)
global {
perm_cache=1024;
cache_dir="/var/cache/pdnsd";
# pid_file = /var/run/pdnsd.pid;
run_as="pdnsd";
server_ip = eth1; # Use eth0 here if you want to allow other
# machines on your network to query pdnsd.
กำหนด DNS server ที่ pdnsd จะ query (พอดีใช้ OpenDNS อยู่)
server {
label = "opendns";
ip = 208.67.222.222, 208.67.220.220;
reject = 208.69.32.0/24, # You may need to add additional address ranges
208.69.34.0/24, # here if the addresses of their search engines
208.67.219.0/24; # change.
reject_policy = fail; # If you do not provide any alternative server
# sections, like the following root-server
# example, "negate" may be more appropriate here.
timeout = 4;
uptest = ping; # Test availability using ICMP echo requests.
ping_timeout = 100; # ping test will time out after 10 seconds.
interval = 15m; # Test every 15 minutes.
preset = off;
}
แก้ /etc/resolv.conf
$ vi /etc/resolv.conf
nameserver 127.0.0.1
คอนฟิก Squid ให้ทำงานร่วมกับ pdnsd (default อ่านค่าจากไฟล์ /etc/resolv.conf)
$ vi /etc/squid/squid.conf
dns_nameservers 127.0.0.1
$ squid -k reconfigure
ทดสอบ ค่า Query หลังคอนฟิกเสร็จ
$ dig susethailand.com
*** ถ้าเวลาที่ใช้ในการ Query ลดลงแสดงว่าทำงานแล้ว
อ้างอิจ
http://linuxgazette.net/issue65/sunil.html

SUSE Linux Enterprise Cool Solutions
|












