1

I installed pdnsd: it is correctly working.

My problem is that it ignores the opendns server I provided in the "server" section of pdnsd.conf labeled "resolvconf": instead of it, it uses the server which is provided by the dhcp.

On the other hand, if I change the name of the server section to something else, then pdnsd correctly uses the opendns server but resolvconf put the dns provided by dhcp in resolv.conf, so pdnsd is bypassed.

So, my question is: how can I have resolvconf set resolv.conf to 127.0.0.1 AND pdnsd use opendns server when the request is not cached?

One workaround I found is to set, in network manager, "DHCP (address only)" for the connection, but the problem with this is that it must be set for every different connection: this means that if you use a laptop you have to change it for every wifi to which you connect!

2
  • Can you implement this by editing /etc/resolvconf/update.d/pdnsd?
    – jdthood
    Apr 30, 2014 at 19:12
  • The script you point to looks quite obscure to me: I don't dare to modify it. Nevertheless, I think I found a solution: I add it in a separate answer.
    – brad
    Apr 30, 2014 at 20:26

1 Answer 1

2

I think I have found myself the solution: adding

supersede domain-name-servers 127.0.0.1;

to /etc/dhcp/dhclient.conf does the job.

So maybe it can be useful for someone else if I write my short howto to have pdnsd work in ubuntu with fixed (say, opendns) domain name server, regardless of the used connection.

  • Disable dnsmasq by editing /etc/NetworkManager/NetworkManager.conf and commenting out #dns=dnsmasq
  • Force network-manager to set the dns to 127.0.0.1 for every connection by adding

    supersede domain-name-servers 127.0.0.1;
    

    to /etc/dhcp/dhclient.conf

  • Install pdnsd
  • Edit /etc/default/pdnsd and set START_DAEMON=yes
  • Configure pdnsd to use your favourite dns. For example, to use opendns your /etc/pdnsd should look like as

    global {
     perm_cache=16536;
     cache_dir="/var/cache/pdnsd";
     max_ttl=604800;
     run_as="pdnsd";
     paranoid=on;
     status_ctl=on;
     neg_rrs_pol=on;
     par_queries=1;
    }
    server {
     label="opendns";
     ip="208.67.222.222","208.67.220.220";
     timeout=30;
     interval=30;
     uptest=ping;
     ping_timeout=50;
     purge_cache=off;
     proxy_only=on;
    }
     source {
     ttl=86400;
     owner="localhost.";
     file="/etc/hosts";
    }
    
  • Restart pdnsd and the network connection:

    sudo service pdnsd restart
    sudo invoke-rc.d network-manager restart
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .