Welcome to http://www.marssoft.de/
 
Friday, 21st September 2018 03:01:17 (GMT+1) 

DNS-Caching

Found on http://www.debian-administration.org/articles/390 a nice tutorial on DNS Caching. That is something I have been longing to get my fingers on for quite some time. Why? Two things:

  • First, the server can use the caching to reduce load for creating logfiles (else, every long-browsing user will create multiple lookups).
  • Second, on my home computer I use vmware for running a windows guest. That often ends up lacking the dns resolution for my linux host :-(

Now I wonder if it is easy to add my own custom responses, so that vmware will always resolve “wasabi” to the linux box and vmware to the windows… :-)

Installation / Configuration

aptitude install pdnsd
perl -pi -e 's/(START_DAEMON)=.*/${1}=yes/g' /etc/default/pdnsd
/etc/init.d/pdnsd restart

nano /etc/pdnsd.conf

global {
	perm_cache=1024;
	cache_dir="/var/cache/pdnsd";
	run_as="pdnsd";
	server_ip=any;  // Use eth0 here if you want to allow other
			// machines on your network to query pdnsd.
	status_ctl=on;
  	paranoid=off;
	min_ttl=15m;       // Retain cached entries at least 15 minutes.
	max_ttl=2h;	   // but max two hours.
	timeout=10;        // Global timeout option (10 seconds).
}

server {
    label="resolvconf";
}

// This section is meant for resolving from root servers.
server {
	label="root-servers";

	// Nameserver der ETH Zürich
	ip=129.132.98.12;
	// Nameserver der Uni Freiburg
	ip=132.230.200.200;

	timeout=5;
	uptest=query;
	interval=1h;       // Test every half hour.
	ping_timeout=300;  // 30 seconds.
}

source {
	owner=localhost;
	serve_aliases=on;
	file="/etc/hosts";
}

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

neg {
	name=doubleclick.net;
	types=domain;   // This will also block xxx.doubleclick.net, etc.
}
internal/server/dns.txt · Last modified: 2014/04/02 22:39 (external edit)