You are not logged in.

#1 2011-12-08 11:58:18

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

[Solved] Problems while running pdnsd

Hello everyone,

i've tried to use pdnsd, but it seems that there's something I've missed, because I can't get it to speed up anything.

But first some infos: I'm running gnome-shell with network-manager-applet and I've configured pdnsd as follows:

pacman -S pdnsd
cp /etc/pdnsd.conf.sample /etc/pdnsd.conf

I've created a group for it

groupadd pdnsd
useradd -r -d /var/cache/pdnsd -g pdnsd -s /bin/false pdnsd

made the directories/files writeable for the group

chown -R pdnsd:pdnsd /var/cache/pdnsd
chmod 700 /var/cache/pdnsd
chmod 600 /var/cache/pdnsd/pdnsd.cache

Then I've added myself to the group "pdnsd" and edited the config:

// Sample pdnsd configuration file. Must be customized to obtain a working pdnsd setup!
// Read the pdnsd.conf(5) manpage for an explanation of the options.
// Add or remove '#' in front of options you want to disable or enable, respectively.
// Remove '/*' and '*/' to enable complete sections.

global {
	perm_cache=4096;
	cache_dir="/var/cache/pdnsd";
#	pid_file = /var/run/pdnsd.pid;
	run_as="pdnsd";
	server_ip = 127.0.0.3;  # Use eth0 here if you want to allow other
				# 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.
	timeout=10;        # Global timeout option (10 seconds).
	neg_domain_pol=on;
}

# 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= "OpenNIC";
	ip = 64.0.55.201;  # 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.
	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.
}

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;
}

I've created /etc/resolv.conf.head and put the following in:

# pdnsd cache @ localhost
nameserver 127.0.0.3

Then I've started pdnsd and tested it with:

dig www.google.de

First time it gave me a query time of 46sec, the second time, where it should be much faster, it stays the same. So I guess pdnsd isn't running correctly. Did I missed something?

Last edited by Thorsten Reinbold (2013-01-31 11:59:31)

Offline

#2 2011-12-08 12:45:57

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: [Solved] Problems while running pdnsd

why 127.0.0.3 ?

I'll stick with localhost 127.0.0.1. it's working fine here...

Offline

#3 2011-12-08 13:08:23

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

mangus wrote:

why 127.0.0.3 ?

I'll stick with localhost 127.0.0.1. it's working fine here...

This is not really important, as long as the configs both point to 127.0.0.3. But by the way: I could solve it. The Problem was that network-manager still was set to "automatic (DHCP)". After I've feed it with the correct IP manually (127.0.0.3) everything is working fine.

Offline

#4 2011-12-08 18:25:41

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

Ok, guess I was happy too soon. After a reboot, it didn't worked again.

Any site that is not already resolved by pdnsd (and in its database) failes to load. I can only get on "new" pages when setting network manager back to "Automatic (dhcp)" and reconnect eth0.

What am I'm doing wrong? I followed the WIKI step by step.

Last edited by Thorsten Reinbold (2011-12-08 19:18:45)

Offline

#5 2011-12-08 18:43:20

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

Here are some infos from messages.log:

Dec  8 19:33:53 localhost dhcpcd[509]: eth0: acknowledged 192.168.1.36 from 192.168.1.1
Dec  8 19:33:53 localhost dhcpcd[509]: eth0: checking for 192.168.1.36
[...]
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| Received query.
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| Questions are:
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| 	qc=IN (1), qt=A (1), query="dl.dropbox.com."
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| Starting cached resolve for: dl.dropbox.com., query A
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| Trying name servers.
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| No server is marked up and allowed for this domain.
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| Outbound msg len 32, tc=0, rc="server failed"
Dec  8 19:34:19 localhost pdnsd[416]: 1 12/08 19:34:19| Answering to: 127.0.0.1, source address: 127.0.0.1
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| Received query.
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| Questions are:
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| 	qc=IN (1), qt=A (1), query="dl.dropbox.com."
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| Starting cached resolve for: dl.dropbox.com., query A
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| Trying name servers.
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| No server is marked up and allowed for this domain.
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| Outbound msg len 32, tc=0, rc="server failed"
Dec  8 19:34:19 localhost pdnsd[416]: 2 12/08 19:34:19| Answering to: 127.0.0.1, source address: 127.0.0.1
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| Received query.
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| Questions are:
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| 	qc=IN (1), qt=A (1), query="dl.dropbox.com."
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| Starting cached resolve for: dl.dropbox.com., query A
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| Trying name servers.
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| No server is marked up and allowed for this domain.
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| Outbound msg len 32, tc=0, rc="server failed"
Dec  8 19:34:19 localhost pdnsd[416]: 3 12/08 19:34:19| Answering to: 127.0.0.1, source address: 127.0.0.1
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| Received query.
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| Questions are:
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| 	qc=IN (1), qt=A (1), query="dl.dropbox.com."
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| Starting cached resolve for: dl.dropbox.com., query A
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| Trying name servers.
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| No server is marked up and allowed for this domain.
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| Outbound msg len 32, tc=0, rc="server failed"
Dec  8 19:34:19 localhost pdnsd[416]: 4 12/08 19:34:19| Answering to: 127.0.0.1, source address: 127.0.0.1

Maybe someone can give me a hint...

Offline

#6 2011-12-08 20:24:41

b4data
Member
Registered: 2010-12-14
Posts: 141

Re: [Solved] Problems while running pdnsd

Does your network only become available after your pdnsd daemon starts? This can cause this problem.

Ensure that you have

debug=on;

set in the global section of your /etc/pdnsd.conf and check /var/cache/pdnsd/pdnsd.debug after a

/etc/rc.d/pdnsd restart

If it reports uptest problems, two possible workarounds are to either set your uptest timeout to ~1m (or whatever suits your setup) (and be without dns for 60s (or whatever)), or to set uptest to none. If pdnsd fails an uptest, it won't even try to resolve until it completes a successful one.

Last edited by b4data (2011-12-08 20:27:55)

Offline

#7 2011-12-08 22:33:29

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

Thanks for your reply, but I guess that networkmanager is causing the problems. I've replaced it with "network" in rc.conf and now pdnsd runs without problems.

But, of course, it would be nice to make them both work together. Does anyone know what could cause pdnsd not to work correctly while networkmanager is running?

Offline

#8 2011-12-09 10:05:09

njoerd
Member
Registered: 2011-09-18
Posts: 6

Re: [Solved] Problems while running pdnsd

Came across that same problem yesterday, solved it by setting

ip=8.8.8.8, 8.8.4.4;

in the server section of pdnsd.conf. It is the address of a default nameserver (google in this case) to look up addresses that are not already cached.

Offline

#9 2011-12-09 11:55:51

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

This was already set to 64.0.55.201 (OpenNIC), changing to Google DNS does not changing anything.

Offline

#10 2011-12-09 12:14:39

njoerd
Member
Registered: 2011-09-18
Posts: 6

Re: [Solved] Problems while running pdnsd

Are you sure you used the right section (and commented the others out?)
Here's what my pdnsd.conf looks like:

global {
	perm_cache=1024;
	cache_dir="/var/cache/pdnsd";
#	pid_file = /var/run/pdnsd.pid;
	run_as="pdnsd";
	server_ip = 127.0.0.1;  # Use eth0 here if you want to allow other
				# 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=15m;       # Retain cached entries at least 15 minutes.
	max_ttl=1w;        # One week.
	timeout=10;        # Global timeout option (10 seconds).
	neg_domain_pol=on;
#	strict_setuid=on;
}
# The following section is more appropriate for dial-up connections.
# Read about how to use pdnsd-ctl for dynamic configuration in the documentation.
server {
	label= "dialup";
#	file = "/etc/ppp/resolv.conf";  # Preferably do not use /etc/resolv.conf
	file = "/etc/resolv.conf";  # Preferably do not use /etc/resolv.conf
	proxy_only=on;
	timeout=4;
	uptest=if;
	interface = ppp0;
	interval=10;       # Check the interface every 10 seconds.
	purge_cache=off;
	preset=off;
	ip=8.8.8.8, 8.8.4.4;
}
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;
}

All the rest of it is commented out and not posted. Works like a charme!

Offline

#11 2011-12-09 12:33:53

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

global {
	perm_cache=2048;
	cache_dir="/var/cache/pdnsd";
#	pid_file = /var/run/pdnsd.pid;
	run_as="root";
	server_ip = 127.0.0.1;  # Use eth0 here if you want to allow other
				# machines on your network to query pdnsd.
	status_ctl = off;
	linkdown_kluge=on
	strict_setuid=off
#	paranoid=on;       # This option reduces the chance of cache poisoning
	                   # but may make pdnsd less efficient, unfortunately.
	query_method=udp_tcp;
	min_ttl=15m;       # Retain cached entries at least 15 minutes.
	max_ttl=1w;        # One week.
	par_queries=2
	timeout=10;        # Global timeout option (10 seconds).
	neg_domain_pol=on;
}

# 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= "GoogleDNS";
#	ip = 192.168.0.1;  # Put your ISP's DNS-server address(es) here.
	ip = 8.8.4.4, 8.8.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.
	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.
}

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;
}

Offline

#12 2011-12-09 13:02:56

njoerd
Member
Registered: 2011-09-18
Posts: 6

Re: [Solved] Problems while running pdnsd

One last try:

Thorsten wrote:

The I've created /etc/resolv.conf.head and put the following in:

Shouldn't the filename be simply /etc/resolv.conf?

Offline

#13 2011-12-09 13:28:22

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

Yes, you're right. I found this info on a tutorial, but I wasn't sure if this file is used at all. So I've made the neccessary changes to both files. Resolv.conf points to 127.0.0.1.

Offline

#14 2011-12-09 13:31:30

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

Just to make it clear: it runs know. But only if I'm deaktivating networkmanager and nm-applet.

Offline

#15 2011-12-09 13:39:03

njoerd
Member
Registered: 2011-09-18
Posts: 6

Re: [Solved] Problems while running pdnsd

I don't run either of them.

Offline

#16 2011-12-10 18:11:45

b4data
Member
Registered: 2010-12-14
Posts: 141

Re: [Solved] Problems while running pdnsd

So you only experience the problem when using networkmanager/nm-applet and not when using "network" in rc.conf? Does nm only connect to your network after a delay, for example after your desktop becomes available? And does "network" connect immediately after the daemon starts? If so, you might want to take another look at my earlier suggestion.

Last edited by b4data (2011-12-10 18:14:40)

Offline

#17 2011-12-11 15:22:37

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

I could solve this, but I'm not really sure what's the reason for those problems.

I changed /etc/resolv.conf to 127.0.0.1 and set the immutable flag. At this time, it still wasn't working, so I also set it (again) via Networkmanager-Applet. For now it is working as expected.

But this is really annoying, because I have the feeling that I didn't really understand what was going wrong here.


@b4data: thanks for your hint, but I checked that and I could not see any errors related to uptest.

Offline

#18 2011-12-29 14:58:01

cap_sensitive
Member
Registered: 2010-04-05
Posts: 35

Re: [Solved] Problems while running pdnsd

I don't know if networkmanager uses dhclient to deal with resolv.conf in your case. (dhclient is an optional dep for networkmanager, so not really sure). If that, you probably should edit dhclient.conf to make it recogize pdnsd at 127.0.0.3. You may find some info at https://wiki.archlinux.org/index.php/Sp … th_dnsmasq (about how to edit dhclient.conf)

Last edited by cap_sensitive (2011-12-29 14:59:27)

Offline

#19 2013-01-31 11:57:15

Thorsten Reinbold
Member
From: Germany
Registered: 2011-12-06
Posts: 314

Re: [Solved] Problems while running pdnsd

Its been a while since my last visit here.

To clarify: nm-connection-editor has to be run as root for this setting. Then it works fine and without any problems. wink

Offline

Board footer

Powered by FluxBB