Jul 092012
 

OpenDNS è un fornitore di DNS popolare ampiamente utilizzato sia per o server che per i computer casalinghi, una delle caratteristiche che forniscono ai loro clienti è DNSCrypt , un miglioramento della protezione che aggiunge una protezione contro tutti gli attacchi basati su DNS, come il cache poisoning .

Allo stesso modo in cui SSL fa diventare il traffico HTTP nel traffico Web cifrato HTTPS, DNSCrypt fa diventare il traffico DNS in traffico DNS cifrato che è sicuro da intercettazioni e man-in-the-middle. Non richiede alcuna modifica ai nomi di dominio o il modo in cui funzionano i nameserver, fornisce semplicemente un metodo sicuro per la codifica delle comunicazioni tra i clienti di OpenDNS ed i loro server DNS. Il software è rilasciato come open source su GitHub .

Al momento questa soluzione funziona solo in combinazione con OpenDNS, il che significa che avete bisogno di cambiare il vostro fornitore DNS all’interno del computer in OpenDNS per utilizzare questa funzione di sicurezza, che è il loro business dopo tutto.

Vediamo nel dettaglio come usarlo su Linux.



Installazione per Debian dovrebbero funzionare anche su Ubuntu.
La seguente guida si basa sull’articolo trovato su http://shadowmax.referata.com/

Prerequisiti

Per migliorare le performance facciamo uso di un Name Service Caching Daemonnscd:

sudo apt-get install nscd
sudo service nscd stop

sudo sed -i -E -e '/^\s*persistent\s*(passwd|group|hosts|services|netgroup)\s*yes/s/yes/no/g' \
               -e '/^\s*enable-cache\s*(passwd|group|services|netgroup)\s*yes/s/yes/no/g' \
               -e '/^\s*enable-cache\s*hosts\s*no/s/no/yes/g' /etc/nscd.conf
sudo service nscd start

Abilitiamo inoltre il supporto al Extension Mechanisms for DNS:

echo "options edns0" | sudo tee -a /etc/resolvconf/resolv.conf.d/tail

e disabilitiamo il local resolver:

sudo sed -i 's/^dns=dnsmasq/#dns=dnsmasq/g' /etc/NetworkManager/NetworkManager.conf
sudo restart network-manager

Creiamo un utente di sistema dedicato, senza una shell e con una home directory vuota, da usare per eseguire dnscrypt-proxy:

sudo adduser --system --quiet --home /run/dnscrypt --shell /bin/false \
             --group --disabled-password --disabled-login dnscrypt

Installazione

Scarichiamo il pacchetto dnscrypt-proxy in formato deb:

https://github.com/opendns/dnscrypt-proxy/downloads

e procediamo alla sua installazione:

sudo dpkg --install dnscrypt-proxy_*.deb

Creiamo infine un Upstart script per fare in modo che DNSCrypt venga avviato automaticamente all’avvio:

echo '
description "dnscrypt-proxy startup script"

pre-start script
    mkdir -p /run/dnscrypt
end script

start on (local-filesystems and net-device-up IFACE=lo)
stop on runlevel [!2345]

exec /usr/sbin/dnscrypt-proxy --local-address=127.0.0.2 \
                              --edns-payload-size=4096 \
                              --pidfile=/run/dnscrypt-proxy.pid \
                              --resolver-port=443 \
                              --user=dnscrypt \
                              --local-port=53 \
                              --tcp-only
' | sudo tee /etc/init/dnscrypt-proxy.conf
sudo ln -s /lib/init/upstart-job /etc/init.d/dnscrypt-proxy
sudo start dnscrypt-proxy

Configurazione

Per utilizzare DNSCrypt e’ sufficiente modificare nelle proprieta’ di rete la voce DNS servers con 127.0.0.2.
Per testare che tutto sta’ funzionando a dovere, andate qui

Installazione per Mint, Red Hat Enterprise, Centos e Fedora.

dnscrypt-proxy è disponibile anche come pacchetto RPM nella pagina ufficiale di Download: https://github.com/opendns/dnscrypt-proxy/downloads, installatelo e poi lanciate:

sudo /usr/sbin/dnscrypt-proxy --daemonize

Dopodiche dovrete fare il setup delal vostra connessione di rete, cambiando il DNS namserver a 127.0.0.1:

edit-network

Se tutto funziona, e volete che dnscrypt-proxy parta automaticamente al boot aggiungete questa linea al vostro file /etc/rc.local:

/usr/sbin/dnscrypt-proxy --daemonize

Ed infine se si utilizza Linux Mint c’è una buona guida per l’installazione di DNSCrypt sul forum ufficiale Mint forum

Conclusioni

Dal mio punto di vista questa è una buona opzione per aggiungere un ulteriore livello di sicurezza, se potete e volete utilizzare OpenDNS come vostro name server, ma penso anche che non sia facilmente fattibile in molte società, perché è necessario utilizzare il proprio server DNS per associare correttamente i propri domini privati​​, quindi come prima cosa si potrebbe verificare questa soluzione sui computer di casa.

Popular Posts:

Flattr this!

  10 Responses to “DNSCrypt, cifrate le vostre richieste DNS.”

  1. You forgot to mention that opendns is a censoring DNS that censors specific domains, so by using opendns you will be at the mercy of what opendns decides you are allowed to see.

  2. I miss Ubuntu (or Debian) package with DNScrypt, package with well designed start/stop scripts. I noticed some try to create Ubuntu package in the past but that try was not well done. This article is nice but well designed package for #1 distribution can do more for DNScrypt…

  3. DNScrypt being related to OpenDNS you must be aware of two facts.

    The only openness of OpenDNS is in its name and price (free as free in beer).

    But OpenDNS is not free as free in speech. Quite the contrary, OpenDNS is filtering web access based on “political correctness” rules (at least this was true the last time i had checked it, something like two years ago, no risk for me to come back to a censor company 😉 ). So depending of your choice this may be or not be a good decision. You are only warned from now on.

    • Ok… give some examples, please… Since I can access thepiratebay fine through opendns, I can’t imagine what sites (other than what they state they censor) they would censor. Oh, and please suggest other free non-censoring dns-providers to use. Where I am all isp’s, censors blocks access to many, many websites (it’s the law…). Google very much wants to track you (but you _can_ opt-out, then you just have to trust they don’t) and are definately under US censoring laws (not sure about opendns)… blah… blah…

  4. In ubuntu 12.04 (3.2.0-26-generic x86_64) the following commands doesn’t work:

    1) sudo sed -i -E -e ‘/^s*persistents*(passwd|group|hosts|services|netgroup)s*yes/s/yes/no/g’
    -e ‘/^s*enable-caches*(passwd|group|services|netgroup)s*yes/s/yes/no/g’
    -e ‘/^s*enable-caches*hostss*no/s/no/yes/g’ /etc/nscd.conf

    error: “no input files”

    2) sudo adduser –system –quiet –home /run/dnscrypt –shell /bin/false
    –group –disabled-password –disabled-login dnscrypt

    error “only one or two names allowed”

    3) sudo start dnscrypt-proxy
    works this way:
    sudo dnscrypt-proxy start

  5. […] guide got me 90% of the way. http://linuxaria.com/howto/dnscrypt-crypt-your-dns-request?lang=en Share this:TwitterFacebookLike this:LikeBe the first to like […]

  6. The instructions above don’t work.

    And it is not an OpenDNS product. They are just running it on their servers like others.

    The official DNSCrypt website is https://dnscrypt.org

Leave a Reply to javier Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*