How To Patch BIND9 Against DNS Cache Poisoning On Debian Etch
How To Patch BIND9 Against DNS Cache Poisoning On Debian EtchVersion 1.0 This article explains how you can fix a BIND9 nameserver on a Debian Etch system so that it is not vulnerable anymore to DNS cache poisoning. This document comes without warranty of any kind! I do not issue any guarantee that this will work for you!
1 Checking If BIND Is VulnerableRun the following command against your nameserver to find out if it is vulnerable (replace ns1.example.com with your own nameserver address): dig +short @ns1.example.com porttest.dns-oarc.net TXT mh1:~# dig +short @ns1.example.com porttest.dns-oarc.net TXT POOR indicates that BIND is vulnerable. In this case you must patch BIND. If you don't get any answer at all, this means that your DNS server is no recursive resolver which means it doesn't answer queries for domains that it isn't authoritative for. In this case you're not vulnerable to cache poisoning, but still I strongly advise to update BIND!
2 Patching BINDThis is not so much a patch, but an update. Simply run apt-get install bind9 bind9-host This will install the updated BIND packages from the Debian repositories. Afterwards open /etc/bind/named.conf and modify the options section. If you don't need a recursive resolver (i.e., if your nameserver should answer only queries for domains that it is responsible for), add allow-recursion { none; };. That way you turn off caching for other domains. The second line you should add is dnssec-enable yes; - this makes that BIND answers queries on random ports which are harder to guess for hackers (remember the answer to our dig command in chapter 1: [...]26 queries in 4.4 seconds from 1 ports[...] - BIND was answering on only one port...). Correction: I've just received the following email from Alan Clegg:
vi /etc/bind/named.conf
Restart BIND afterwards: /etc/init.d/bind9 restart (If you're using ISPConfig, your changes will be overwritten by ISPConfig. To prevent this, we take the named.conf template file /root/ispconfig/isp/conf/named.conf.master, modify it as shown above, and save the modified template in the /root/ispconfig/isp/conf/customized_templates directory => /root/ispconfig/isp/conf/customized_templates/named.conf.master. Please also modify /etc/bind/named.conf as shown above in addition to that.)
3 Checking BIND AgainNow we run the query from chapter 1 again: dig +short @ns1.example.com porttest.dns-oarc.net TXT If all went well, it should now show GOOD instead of POOR, and it should use more than just one port: mh1:~# dig +short @ns1.example.com porttest.dns-oarc.net TXT Congratulations, you have just fixed BIND! You can also run the dig command against your ISP's nameservers to find out if their nameservers are still vulnerable. If they are, you should urge your ISP to update their nameservers!
|






Recent comments
12 hours 44 min ago
13 hours 41 min ago
13 hours 53 min ago
19 hours 58 min ago
22 hours 27 min ago
23 hours 38 min ago
1 day 2 hours ago
1 day 3 hours ago
1 day 5 hours ago
1 day 7 hours ago