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

Related posts:

  • Fixing open DNS servers
  • The Definite Guide of Obscure Tweaks to Install and Maintain cPanel / WHM (version 10)
  • Linux: What you should have on your Ubuntu lady
  • Tags

    AI apple behavioural-targeting business christianity Computing cPanel design DNS Downloads Games GNU/Linux google hacking Hardware headphones hosting Ideas Instant Messaging iphone islam marketing online-advertising online media Personal Philosophy poker Programming satire scripts search Security sociology startups technology Travel ubuntu v-moda Visionarism web-2.0 web-marketing Web Design WHM wunderloop
  • 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

      • Twentysix restructures senior staff roles 10 October, 2008
      • Geraldine Wilson leaves Yahoo for Truphone 10 October, 2008
      • Swiftcover launches UGC competition 10 October, 2008
    • RSS Brand Republic

      • ITV signs Sony for exclusive England sponsorship 10 October, 2008
      • TBWA-BMB deal scrapped at 11th hour 10 October, 2008
      • Nielsen forms China joint venture for web rankings 10 October, 2008
    • RSS iMedia Connection: Consumer Strategies

      • How to tailor display to every user
      • 3 top tools for branding in a Web 2.0 world
      • How to create better brand advocates
    • RSS Behavioural Targeting news

      • Revenue Science: On Standards, Those Verticals, and Independence - Mediapost.com 10 October, 2008
      • Revenue Science's Behavioral Targeting Solution for Advertisers ... - MarketWatch 30 September, 2008
      • Socializing With Media6Degrees: How Targeting Fits In - ClickZ News 8 October, 2008
      • Obama, McCain: Optimize Your Ads With BT - Mediapost.com 8 October, 2008
      • Online Execs Object To Privacy Statement Report - MediaPost Publications 10 October, 2008
    • RSS Adotas

      • Media Plan ’08: Look Out of the Window 10 October, 2008
      • Hiring Round Up: HealthCentral, Break Media, NetShelter 10 October, 2008
      • Microhoo: Back From the Dead? 10 October, 2008
    • RSS MarketingVox

      • YHOO Stakeholder Appeals to MSFT on Bended Knee
      • Verizon Lobs Per-Text Charge on Content Providers
      • Google Maps, Now Infused with AdSense
    • RSS SimsCity blog

      • Scalability 8 July, 2008
      • A message to Mac users 5 July, 2008
      • Transfering files from computer to iPhone 26 June, 2008
    • RSS Donald Hamilton

      • Online ad spending bucks trends 29 September, 2008
      • Ad:Tech 25 September, 2008
      • Phorm in the clear? 18 September, 2008
    • RSS Don't be Square

      • x 11 September, 2008
      • See no evil with TELEVISION 18 August, 2008
      • Science meets Culture = PHILOTAXIS 14 August, 2008
    • Ads

    • RSS mindcode

      • Proof of God 30 September, 2008
      • Good old-skool h4Ă—0r! 29 September, 2008
      • PLoP paper accepted 17 September, 2008
    • RSS ZDnet Security

      • Microsoft expected to release Silverlight 2 next week 10 October, 2008
      • Microsoft renames its 'D' language 'M' 10 October, 2008
      • The Apple II is baaaaccckk (via emulator) 10 October, 2008
    • TechDispenser


    • 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
    • Personal

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

      • Hermetic Research
      • 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

      32,059 spam comments
      blocked by
      Akismet

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