SkyHorse.Org

Fixing open DNS servers

Ok, there seems to be a *lot* of posts and threads about this issue and I think a simple page is appropriate.

Lets start with the problem. Check the report for your domain here: http://www.dnsreport.com/tools/dnsreport.ch?domain=YOUR_DOMAIN_HERE.COM

An open DNS server is one that replies to a query about a domain it is not responsible for, to anyone who asks for it, also known as recursion. For starters, that is just a waste of processing time, but it can be worse if it is used for flooding. See, since a DNS query is (much!) smaller in number of bytes than a DNS response, if it is spoofed it can be used to perform a DoS attack on a computer with several times the bandwidth of the perpretator.

So, lets solve it. First of all you need to find out where you named.conf file is. Ok, 99% of the time is in /etc/named.conf but trust me, even if you find one there, there is a chance that is no the one being used. Check the result of:

cat /etc/sysconfig/named

If it has a ROOTDIR entry, something like:

ROOTDIR=/var/named/chroot

then chances are it is going to be a different named.conf

If so, follow to that directory and look for the etc directory, ex:
cd /var/named/chroot/etc/

There should be a named.conf here. Make a backup of it, and the idea is to add some lines looking like this:

acl “trusted” {
127.0.0.1;
69.16.205.44;
69.16.205.45;
69.16.205.46;
69.16.205.47;
209.59.139.5;
209.59.139.6;
};

//
// named.conf for Red Hat caching-nameserver
//

options {
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;

//by skyhorse
version “SkyServers UltraDNS 2.0 *Beta”;
allow-recursion { trusted; };
allow-notify { trusted; };
allow-transfer { trusted; };
allow-query { any; };

…

};

Now, the parts in bold are the ones you probably don’t have. The “acl” is the list of IP addresses that have access to the recursion option, this is very important otherwise other parts of your server will stop working, such as Exim. You should list *all* addresses that might need DNS recursion, such as *all* local IP’s and some more.

This script should output to you all the IP’s you probably need:

echo “acl \”trusted\” {“
echo “127.0.0.1;”
echo `/bin/hostname -i`\;
for i in `cat /etc/ips | cut -d “:” -f 1`
do
echo $i\;
done
for a in `cat /etc/resolv.conf | tr -s ” ” ” ” | cut -d ” ” -f2`
do
echo $a\;
done
echo “};”

(you can download it here)

A lot more can be said, if you need any additional details have a look at these threads:

http://forums.cpanel.net/showthread.php?t=50473

http://forums.cpanel.net/showthread.php?t=53064

http://forums.cpanel.net/showthread.php?p=217540

http://forums.cpanel.net/showthread.php?p=242467

Also:

Secure BIND Template

For additional information on how to secure your DNS server check CERT’s pdf at http://www.cert.org/archive/pdf/dns.pdf

  • Google Buzz
  • Delicious
  • Facebook
  • Twitter
  • LinkedIn
  • Share/Bookmark

Related posts:

  • Fixing open DNS servers
  • The Definite Guide of Obscure Tweaks to Install and Maintain cPanel / WHM (version 10)
  • DirectAdmin to cPanel : a partial BASH solution
  • Tags

    AI apple behavioural-targeting business Computing cPanel deep packet inspection design Downloads Games GNU/Linux google hacking hacking Hardware headphones hosting Ideas Instant Messaging iphone marketing mod-security online-advertising online media Personal Philosophy phorm poker Programming satire scripts Security sociology startups technology Travel ubuntu v-moda Visionarism web-2.0 web-marketing Web Design WHM wunderloop yahoo
  • Pages

    • About
    • Web Server Administration
      • Auto update modsecurity rules – modsec.sh
      • DirectAdmin to cPanel : a partial BASH solution
      • The Definite Guide of Obscure Tweaks to Install and Maintain cPanel / WHM (version 10)
        • Configuring E-mail (Exim) related areas
        • Fixing open DNS servers
        • Monitoring your server
        • Scripts and misc information
        • Security by Obscurity
        • Tweaking apache web server
  • Twitter Updates

    • Ads

    • RSS NMA

      • MySpace allows users to sync with Facebook 31 August, 2010
      • YouTube in first full-length movie deal with Blinkbox 27 August, 2010
      • nma Social Media Social takes place next Thursday 26 August, 2010
    • RSS Brand Republic

      • STV appoints Peter Reilly as commercial director 1 September, 2010
      • Binatone beats Samsung and BlackBerry with budget tablet launch 1 September, 2010
      • Alterian expands social media offer with Intrepid acquisition 1 September, 2010
    • RSS iMedia Connection: Consumer Strategies

      • Social media: What lies ahead
      • The truth about consumers' targeting fears
      • 3 reasons your brand doesn't have more Facebook fans
    • RSS Behavioural Targeting news

      • Moving Targets: Somebody Follow Me, Please? - MediaPost Publications 1 September, 2010
      • Moving Beyond Behavioral Ads - ClickZ News 1 September, 2010
      • Cybercrime Still a Major Concern - eMarketer 1 September, 2010
      • DigiRant: Retargeting Needs Some 411 - digiday:DAILY 31 August, 2010
      • How to Make Google Matter in Social Media - GigaOm (blog) 30 August, 2010
    • RSS Adotas

      • Rose Abdicates Digg Throne as Revolt Continues 1 September, 2010
      • Irony Alert: Zuck Wants Privacy Too 1 September, 2010
      • Yahoo & Dex One Expand Partnership for the Locals 1 September, 2010
    • RSS MarketingVox

      • Top Industry News for 9-01-10: Target to sell Facebook Credits gift cards 1 September, 2010
    • RSS ExchangeWire.com

      • OpenX Partners CCI To Build Out Automated Ad Trading Platform In Japan 1 September, 2010
      • AdAudience Moving Its Audience-Buying Offering From Wunderloop to Nugg.ad 31 August, 2010
      • Aegis H1 Report Shows Sluggish Growth In Europe, But Global Revenues Up 3.1% 27 August, 2010
    • RSS Segmentacion por comportamiento

      • Nota de prensa sobre la compra de wunderloop por Audience Science. 5 July, 2010
      • El gigante americano Audience Science compra wunderloop 5 July, 2010
      • Orange lanza su propio AdExchange 31 March, 2010
    • RSS Sandlines

      • the iPad and Marketing 28 January, 2010
      • The anticipation of disappointment 7 December, 2009
      • Groundhog Day 27 November, 2009
    • Ads

    • Blogroll

      • 90kts
      • Acxiom Poker Nights
      • Amy’s blog
      • Bytter’s blog
      • morena flor no samba da saudade
      • Not Quite There Yet
      • Swedish Pirate Party
    • Cartoons

      • Geek & Poke
      • Order of the Stick
      • User Friendly
    • Gaming

      • Neverwinter Nights
    • online media

      • Knowledge for the Digital Economy
      • Mike on Ads
    • Personal

      • Atelier de Camisa
      • Banksy
      • Designarte
      • My Amazon Wishlist
      • SkyServers.Org
    • Science

      • New Scientist
      • Rex Research
      • ScienceBox
      • Wired
    • Security

      • GPG4Win
      • GPGol
      • GPGShell
      • Mod Security
      • Offline Windows NT(2k,XP) Password Recovery
    • Web Design

      • PageStrength
      • SiteScore
      • UrlTrends
    • Akismet

      55,513 spam comments blocked by
      Akismet
    • Meta

      • Log in
      • Entries RSS
      • Comments RSS
      • WordPress.org

    © 2003 - 2010 Paulo Cunha | SkyHorse.Org is proudly powered by WordPress | Theme based on Bob