Page 5 of 5 FirstFirst ... 345
Results 41 to 44 of 44

Thread: HOWTO: Persistant DNS Caching with pdnsd.

  1. #41
    Join Date
    Mar 2010
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Persistant DNS Caching with pdnsd.

    Thank you for this tutorial. I simply followed your instruction, and up my browsing speed.

    I will read all over the post, and maybe back for some question later (actually, i have some questions but i don't want to bother you with asking the same question twice)
    Last edited by karmila; August 2nd, 2010 at 06:08 AM.

  2. #42
    Join Date
    Mar 2007
    Beans
    16

    Re: HOWTO: Persistant DNS Caching with pdnsd.

    It says that it fails when trying to restart the daemon:

    Code:
    lhaeh@ubuntu:~$ sudo /etc/init.d/pdnsd restart
     * Stopping pdnsd                                                        [ OK ] 
     * Starting pdnsd                                                        [fail]


    I get this from my syslog:
    Code:
    Dec  5 16:09:30 ubuntu pdnsd[13171]: Could not bind tcp socket: Address already in use
    Dec  5 16:09:30 ubuntu pdnsd[13171]: Could not bind to udp socket: Address already in use
    Dec  5 16:09:30 ubuntu pdnsd[13171]: tcp and udp initialization failed. Exiting.
    Dec  5 16:13:03 ubuntu named[3588]: error (network unreachable) resolving 'ns3.mydns.pro/A/IN': 2001:500:1::803f:235#53
    Dec  5 16:13:03 ubuntu named[3588]: error (network unreachable) resolving 'ns2.mydns.pro/AAAA/IN': 2001:7fd::1#53
    Dec  5 16:13:03 ubuntu named[3588]: error (network unreachable) resolving 'ns4.mydns.pro/AAAA/IN': 2001:503:c27::2:30#53
    *SNIP*

    However, when I use dig to measure how long it takes to resolve names, I find that caching IS working.


    Edit: Seems to be a conflict between it and bind, killing named before trying to run pdnsd lets it run, however then bind has issues when you restart it:
    Code:
    lhaeh@ubuntu:~$ sudo killall named
    lhaeh@ubuntu:~$ sudo /etc/init.d/pdnsd restart
     * Stopping pdnsd                                                        [ OK ] 
     * Starting pdnsd                                                        [ OK ]
    
    lhaeh@ubuntu:~$ sudo /etc/init.d/bind9 restart
     * Stopping domain name service... bind9                                        
    rndc: connect failed: 127.0.0.1#953: connection refused
                                                                             [ OK ]
     * Starting domain name service... bind9                                        
    Failed: Bad server label.
    Opening socket /var/cache/pdnsd/pdnsd.status
                                                                             [ OK ]
    So, I guess the thing to do is to keep one of them from trying to use port 953, but I don't know how do that.
    Last edited by lhaeh; December 5th, 2010 at 11:41 PM.

  3. #43
    Join Date
    Feb 2010
    Beans
    48

    Re: HOWTO: Persistant DNS Caching with pdnsd.

    I'm having an issue with local windows servers. For example if I navigate to
    Code:
    smb://dave-12183u0zgf/shareddocs/
    With pdnsd running, no dice. Perform a
    Code:
    sudo /etc/init.d/pdnsd stop
    And I'm back in business.

    Ideas??

  4. #44
    Join Date
    Feb 2009
    Beans
    190

    Re: HOWTO: Persistant DNS Caching with pdnsd.

    Trying to get this DNS caching working for natty 11.04.

    Almost did it - but I can't get it to 'stick'.

    Here's what i did to get it almost working:
    (with thanks to all the contributors to this thread):

    Install pdnsd.
    (Synaptic likes to also install the resolvconf package - this form of the command stops that)
    Code:
    sudo apt-get --no-install-recommends install pdnsd
    Edit the pdnsd config file:
    Code:
    gksu gedit /etc/pdnsd.conf
    And make the changes suggested in post #1, i.e. comment out the server section for resolv.conf, and modify the other server to point to your favourite DNS server.

    Then modify these files:
    Code:
    gksu gedit /etc/dhcp/dhclient.conf
    gksu gedit /etc/dhcp3/dhclient.conf
    to remove the # in the line:
    Code:
    #prepend domain-name-servers 127.0.0.1;
    (i.e. uncomment it).

    Note: I could only get 'nameserver 127.0.0.1' to appear in /etc/resolv.conf by editing /etc/dhcp/dhclient.conf.
    It is pointless editing /etc/resolv.conf as it is automatically generated.

    Finally, check that /etc/default/pdnsd is like this:

    Code:
    # do we start pdnsd ?
    START_DAEMON=yes
    # auto-mode, overrides /etc/pdsnd.conf if set [see /usr/share/pdnsd/]
    #AUTO_MODE=
    # optional CLI options to pass to pdnsd(8)
    START_OPTIONS=
    (If START-DAEMON is commented out, or set to 'no', then it will be impossible to start pdnsd. Also, if AUTO_MODE is set to something, then your custom /etc/pdnsd.conf will be ignored)

    Restart the system and test it using 'dig', e.g.
    dig www.goog.com (some site you haven't visited before)

    Check the dig query worked (no error):
    Code:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33790
    Check the server used was 127.0.0.1
    Code:
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    If you dug an unvisited site, the reported query time should be around 50ms:
    Code:
    ;; Query time: 24 msec
    Do another dig and the query time should become zero.

    To check the cache size is increasing with each new web site, use
    Code:
    sudo pdnsd-ctl status
    The first few lines of printout will contain:

    Code:
    Cache status:
    =============
    10240 kB maximum disk cache size.
    1207140 of 10496000 bytes (11.5%) memory cache used in 5022 entries.

    The contents of my /etc/resolv.conf: (automatically generated)
    Code:
    # Generated by NetworkManager
    domain lan
    search lan
    nameserver 127.0.0.1
    nameserver 192.xxx.yyy.zzz
    (192.xxx.yyy.zzz is my router address)

    However, in my case, pdnsd only worked successfully if, having logged in, I restarted it using:
    Code:
    sudo /etc/init.d/pdnsd restart
    Otherwise dig queries would always return a query time of 0 msec and the cache would not get updated.

    I tried a couple of ways to automatically restart pdnsd during login,

    (a)
    Inserted into /etc/rc.local :
    Code:
    /etc/init.d/pdnsd restart
    (b)
    Put script into /usr/local/bin :
    Code:
    #!/bin/sh
    /etc/init.d/pdnsd restart
    & put a script launcher into /etc/xdg/autostart

    But neither of these helped.

    Something is amiss, but I don't know what.

    [Motive for using pdnsd: if ever the PTB kill the internet by killing dns servers, a cache will mean you still have a connection]
    Last edited by ticket; July 3rd, 2011 at 04:03 PM. Reason: motive

Page 5 of 5 FirstFirst ... 345

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •