You are not logged in.

#1 2008-03-03 21:55:19

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

opera, pdnsd issue

As recommended in the forum, I installed pdnsd to enhance dns lookup. My pdnsd configuration is as follows:

// 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=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;
    strict_setuid = 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).
}

# 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=OpenDNS;
    ip = 208.67.222.222;
    ip = 208.67.220.220;  # 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.
}

/*
# 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
    proxy_only=on;
    timeout=4;
    uptest=if;
    interface = ppp0;
    interval=10;       # Check if the interface every 10 seconds.
    purge_cache=off;
    preset=off;
}
*/

/*
# The servers provided by OpenDNS are fast, but they do not reply with
# NXDOMAIN for non-existant domains, instead they supply you with an
# address of one of their search engines. They also lie about the addresses of 
# of the search engines of google, microsoft and yahoo.
# If you do not like this behaviour the "reject" option may be useful.
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;
}
*/

/*
# This section is meant for resolving from root servers.
server {
    label = "root-servers";
    root_server = on;
    randomize_servers = on; # Give every root server an equal chance
                # of being queried.
    ip =     198.41.0.4
    ,    192.228.79.201
    ,    192.33.4.12
    ,    128.8.10.90
    ,    192.203.230.10
    ,    192.5.5.241
    ,    192.112.36.4
    ,    128.63.2.53
    ,    192.36.148.17
    ,    192.58.128.30
    ,    193.0.14.129
    ,    198.32.64.12
    ,    202.12.27.33
    ;
    timeout = 5;
    uptest = query;         # Test availability using empty DNS queries.
    interval = 30m;         # Test every half hour.
    ping_timeout = 300;     # Test should time out after 30 seconds.
    purge_cache = off;
    exclude = .localdomain;
    policy = included;
    preset = off;
}
*/

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.
}
*/

/*
neg {
    name=bad.server.com;   # Badly behaved server you don't want to connect to.
    types=A,AAAA;
}
*/

But still Opera spends significant time "looking for hostname" around 5-10 seconds. Also, the pdnsd.cache file is of 0 kb. It seems pdnsd is not working. Could someone help me find where the problem is.

Offline

#2 2008-03-03 22:02:15

gorn
Member
Registered: 2008-02-01
Posts: 56

Re: opera, pdnsd issue

Post your /etc/resolv.conf file

If the first nameserver is not 127.0.0.1 then pdnsd will not be used. See the other thread ( http://bbs.archlinux.org/viewtopic.php?id=37294 ) for a few ways to do this with DHCP connections

Offline

#3 2008-03-04 11:50:13

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: opera, pdnsd issue

here is my resolv.conf

#
# /etc/resolv.conf
#

#search <yourdomain.tld>
#BSNL
#nameserver 218.248.240.23
#nameserver 218.248.240.135
#Open DNS
#nameserver 208.67.222.222
#nameserver 208.67.220.220
#Tata Indicom
#nameserver 202.54.29.5
#nameserver 202.54.12.164
nameserver 127.0.0.1

# End of file

Also, I do not use dhcp. I behind an ADSL rounter.

Last edited by ravisghosh (2008-03-04 11:51:14)

Offline

#4 2008-03-18 02:36:18

Manifest0
Member
Registered: 2007-12-17
Posts: 15

Re: opera, pdnsd issue

Try:

#pdnsd-ctl dump

You should get some output.

Hope this helps!

Best regards!

Last edited by Manifest0 (2019-10-15 10:28:06)

Offline

#5 2008-03-18 02:47:44

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: opera, pdnsd issue

Manifest0 wrote:

Forget the size of the /var/cache/pdnsd/pdnsd.cache

Try:

#pdnsd-ctl dump

You should get some output.

Hope this helps!

Best regards!

That did through up some 20 lines of web address and but I guess I have been using pdnsd for last 1 month, there must have been more web addresses and corresponding dns. Moreover, i'm not finding any difference in dns lookup time.

Offline

#6 2008-03-18 16:47:17

Manifest0
Member
Registered: 2007-12-17
Posts: 15

Re: opera, pdnsd issue

It seems working (remember thats a cache not a server, so it will retain the most frequent).

Comment your settings and decomment the opendns settings (you are using the same servers right?).
Try also to change the parameters perm_cache, min_ttl, interval and check if the speed increases. If don't, i don't know why your browser takes that long to looking for hostnames.


Best regards.

Manifest0

Offline

#7 2008-03-19 01:54:05

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: opera, pdnsd issue

Manifest0 wrote:

It seems working (remember thats a cache not a server, so it will retain the most frequent).

Comment your settings and decomment the opendns settings (you are using the same servers right?).
Try also to change the parameters perm_cache, min_ttl, interval and check if the speed increases. If don't, i don't know why your browser takes that long to looking for hostnames.


Best regards.

Manifest0

Do you mean to say, I should use default opendns settings that it came with?

Also could you please suggest some appropriate values for perm_cache, min_ttl, etc.

Offline

#8 2008-03-19 02:29:10

Dirhael
Member
From: /cold/north
Registered: 2008-03-12
Posts: 46

Re: opera, pdnsd issue

ravisghosh wrote:

I behind an ADSL rounter.

ravisghosh wrote:

Moreover, i'm not finding any difference in dns lookup time.

Ideally, you shouldn't be seeing any real difference as many (most?) routers of reasonable quality already does DNS caching.

Offline

#9 2008-03-19 02:53:31

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: opera, pdnsd issue

Dirhael wrote:
ravisghosh wrote:

I behind an ADSL rounter.

ravisghosh wrote:

Moreover, i'm not finding any difference in dns lookup time.

Ideally, you shouldn't be seeing any real difference as many (most?) routers of reasonable quality already does DNS caching.

Does that mean there is not point in going for pdnsd?

Offline

#10 2008-03-19 03:01:08

Dirhael
Member
From: /cold/north
Registered: 2008-03-12
Posts: 46

Re: opera, pdnsd issue

ravisghosh wrote:
Dirhael wrote:
ravisghosh wrote:

I behind an ADSL rounter.

ravisghosh wrote:

Moreover, i'm not finding any difference in dns lookup time.

Ideally, you shouldn't be seeing any real difference as many (most?) routers of reasonable quality already does DNS caching.

Does that mean there is not point in going for pdnsd?

If your router already does cache DNS requests and you are using the router as your DNS server then no, I don't think you will have much use of it.

Offline

#11 2008-03-19 13:33:56

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: opera, pdnsd issue

Dirhael wrote:
ravisghosh wrote:
Dirhael wrote:
ravisghosh wrote:

I behind an ADSL rounter.

Ideally, you shouldn't be seeing any real difference as many (most?) routers of reasonable quality already does DNS caching.

Does that mean there is not point in going for pdnsd?

If your router already does cache DNS requests and you are using the router as your DNS server then no, I don't think you will have much use of it.

How do you find that. Mine is a generic router that my isp gave me. 192.168.1.1 says its a vulcan model from Conexant Systems.

Offline

#12 2008-03-19 15:15:03

Dirhael
Member
From: /cold/north
Registered: 2008-03-12
Posts: 46

Re: opera, pdnsd issue

ravisghosh wrote:
Dirhael wrote:
ravisghosh wrote:

Does that mean there is not point in going for pdnsd?

If your router already does cache DNS requests and you are using the router as your DNS server then no, I don't think you will have much use of it.

How do you find that. Mine is a generic router that my isp gave me. 192.168.1.1 says its a vulcan model from Conexant Systems.

I would have looked around in the web interface of your router as you should hopefully find some reference to it there (e.g. how long to keep the cache etc.). Then again, this information may not be there as many ISP's tend to "simplify" the available options and if that's the case I just don't know. Of course, none of this is relevant if you aren't using the router for DNS requests (just check the output of something like "nslookup google.com" ... it should return the IP of your router).

The "looking for hostname" problem you are mentioning in your original post might possibly be more related to ipv6 though, as I've had the same problem myself in the past. Check the output of

ip a | grep inet6

If you get any output, this might be the reason for that problem. If so, try adding

alias net-pf-10 off

to your /etc/modprobe.conf file and reboot.

Offline

#13 2008-03-20 08:39:40

ravisghosh
Member
From: Intergalactic Spaces
Registered: 2006-10-12
Posts: 516
Website

Re: opera, pdnsd issue

Dirhael wrote:
ravisghosh wrote:
Dirhael wrote:

If your router already does cache DNS requests and you are using the router as your DNS server then no, I don't think you will have much use of it.

How do you find that. Mine is a generic router that my isp gave me. 192.168.1.1 says its a vulcan model from Conexant Systems.

I would have looked around in the web interface of your router as you should hopefully find some reference to it there (e.g. how long to keep the cache etc.). Then again, this information may not be there as many ISP's tend to "simplify" the available options and if that's the case I just don't know. Of course, none of this is relevant if you aren't using the router for DNS requests (just check the output of something like "nslookup google.com" ... it should return the IP of your router).

The "looking for hostname" problem you are mentioning in your original post might possibly be more related to ipv6 though, as I've had the same problem myself in the past. Check the output of

ip a | grep inet6

If you get any output, this might be the reason for that problem. If so, try adding

alias net-pf-10 off

to your /etc/modprobe.conf file and reboot.

true, modprobe.conf was empty and did get some output on putting the above command. And after the recommended changes in modprobe.conf, I'm either not getting "looking for hostname" or it is very brief. Some improvement at last.

Offline

#14 2009-05-05 08:54:20

onguarde
Member
Registered: 2008-09-14
Posts: 144

Re: opera, pdnsd issue

ravisghosh wrote:

Also, the pdnsd.cache file is of 0 kb.

I think I might have just found a problem with the wiki....

I'm facing this exact same problem. Nothing seems to be saved upon a restart of the pdnsd daemon. Frustrated with "slow" hanging lookups, I went into a tweaking spree.

Try this!

dig www.google.com (X2)
pdnsd-ctl dump
/etc/rc.d/pdnsd/restart
pdnsd-ctl dump
dig www.google.com (X2)

I used a script to stop and start all the network interfaces too. Not sure if its necessary here.

The first time I use dig on a webpage, its lookuptime is around 50ms. The next time, it drops to 0 ms(pdnsd is working). However, after restarting the daemon, digging takes 50ms again the first time! It is also clear from the dump(b4 and after) that the lookup entries are only saved in ram.

Curious, I checked the /var/cache/pdnsd.cache and sure enough its OWNED by ROOT! And its size is 0...

ls -l
total 0                                                                                                                   
drwx------  2 pdnsd  pdnsd 112 2009-05-05 16:07 .                                                                         
drwxr-xr-x 14 root   root  368 2009-04-06 00:17 ..                                                                        
-rw-r-----  1 nobody root  0 2008-11-08 20:23 pdnsd.cache                                                               
srw-------  1 pdnsd  pdnsd   0 2009-05-05 16:07 pdnsd.status

I checked the wiki and it appears someone did forget to add instructions to alter the permissions for the cache. Perhaps because it wasn't created yet at that point?

From the wiki,

# mkdir /var/cache/pdnsd
# chown pdnsd:pdnsd /var/cache/pdnsd
# chmod 700 /var/cache/pdnsd

So, I applied the appropriate fix and surely enough, the disk cache starts working! Finally..

chown pdnsd:pdnsd /var/cache/pdnsd.cache
chmod 700 /var/cache/pdnsd.cache

Can anyone confirm this b4 I add this to the wiki?

ps. I guess this serves as an apt reminder to not make baselesss assumptions....
"Forget the size of the /var/cache/pdnsd/pdnsd.cache"

Last edited by onguarde (2009-05-05 09:03:46)

Offline

#15 2009-07-14 01:48:29

enigmamachine42
Member
Registered: 2009-07-14
Posts: 1

Re: opera, pdnsd issue

Yes, I believe that was the problem.  I had something similar happen.  If you run pdsnd for the first time before telling it to run as the pdnsd user, /var/cache/pdnsd and /var/cache/pdnsd/pdnsd.cache will be owned by root.  This will fix your problem:

# chown -R pdnsd:pdnsd /var/cache/pdnsd

Offline

Board footer

Powered by FluxBB