Установка и настройка pdnsd linux (быстрого кэширующего DNS сервера)

Для владельцев Debian устанавливаем пакет

sudo aptitude install pdnsd

У меня Cent OS 6 мне повезло меньше.

 

Скачиваем исходники pdnsd:

cd /tmp/
wget http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-1.2.9-par.src.rpm

Зеркало: http://it.cusmir.ru/files/pdnsd-1.2.9-par.src.rpm

 

Пересобираем пакет:

rpmbuild --rebuild pdnsd-1.2.9-par.src.rpm

 

Ставим пересобраный pdnsd:

cd ~/rpmbuild/RPMS/x86_64/
rpm -ivh pdnsd-1.2.9-par.x86_64.rpm

 

Ставим конфиг из примера:

cp /etc/pdnsd.conf.sample /etc/pdnsd.conf

 

Правим конфиг:

global {
	perm_cache=65536;
	cache_dir="/var/cache/pdnsd";
#	pid_file = /var/run/pdnsd.pid;
	run_as="pdnsd";
	server_ip = any;  # Use eth0 here if you want to allow other
#	server_ip = 91.234.147.5;			# machines on your network to query pdnsd.
	status_ctl = on;
#	paranoid=on;       # This option reduces the chance of cache poisoning
	                   # but may make pdnsd less efficient, unfortunately.
	query_method=udp_tcp;
	min_ttl=60m;       # Retain cached entries at least 15 minutes.
	max_ttl=1w;        # One week.
	neg_ttl=5m;
	timeout=10;        # Global timeout option (10 seconds).
	neg_domain_pol=on;
	udpbufsize=1024;   # Upper limit on the size of UDP messages.
}
 
# The following section is most appropriate if you have a fixed connection to
# the Internet and an ISP which provides good DNS servers.
server {
	label= "myisp";
	ip = 8.8.8.8, 8.8.4.4, 4.2.2.1, 77.88.8.8;
 
# Put your ISP's DNS-server address(es) here.
#	proxy_only=on;     # Do not query any name servers beside your ISP's.
	                   # This may be necessary if you are behind some
	                   # kind of firewall and cannot receive replies
	                   # from outside name servers.
#	caching=on;
	timeout=4;         # Server timeout; this may be much shorter
			   # that the global timeout option.
	uptest=if;         # Test if the network interface is active.
	interface=eth0;    # The name of the interface to check.
	interval=10m;      # Check every 10 minutes.
	purge_cache=off;   # Keep stale cache entries in case the ISP's
			   # DNS servers go offline.
	edns_query=yes;    # Use EDNS for outgoing queries to allow UDP messages
			   # larger than 512 bytes. May cause trouble with some
			   # legacy systems.
#	exclude=.thepiratebay.org,  # If your ISP censors certain names, you may
#		.thepiratebay.se,   # want to exclude them here, and provide an
#		.piratebay.org,	    # alternative server section below that will
#		.piratebay.se;	    # successfully resolve the names.
}
 
 
source {
	owner=localhost;
#	serve_aliases=on;
	file="/etc/hosts";
}
 
/*
include {file="/etc/pdnsd.include";}	# Read additional definitions from /etc/pdnsd.include.
*/
 
rr {
	name=local;
	reverse=on;
	a=127.0.0.1;
	owner=local;
	soa=local,root.local,42,86400,900,86400,86400;
}
 
rr {
       	name=retracker.local;
      	a=192.168.200.15;
}
 
 
/*
neg {
	name=doubleclick.net;
	types=domain;   # This will also block xxx.doubleclick.net, etc.
}
*/
 
/*
neg {
	name=bad.server.com;   # Badly behaved server you don't want to connect to.
	types=A,AAAA;
}
*/

Хороший и понятный разбор конфига pdnsd здесь.

Запись вида:

rr {
	name=local;
	reverse=on;
	a=127.0.0.1;
	owner=local;
	soa=local,root.local,42,86400,900,86400,86400;
}
 
rr {
       	name=retracker.local;
      	a=192.168.200.15;
}

Нужна для поднятия локального ретрекера.

Добавить комментарий