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

      • Facebook sees more US weekly traffic than Google for first time 17 March, 2010
      • Absolute Radio collates presenters' social updates 17 March, 2010
      • Walkers chooses social sites over its own for consumer engagement 17 March, 2010
    • RSS Brand Republic

      • OFT clears Independent sale to Lebedev 17 March, 2010
      • Maurice Levy and Publicis Groupe board to forgo bonus 17 March, 2010
      • Westminster Media Forum: CSR and schools marketing come under fire 17 March, 2010
    • RSS iMedia Connection: Consumer Strategies

      • 5 marketing battles that make no sense
      • The 4 Cs of scaling social media
      • The underlying drivers of social media success
    • RSS Behavioural Targeting news

      • Former Yahoo Data Executives Join Forces to Create nPario, a Startup that ... - IT News Online 17 March, 2010
      • Coke Uses Digital Billboards To Engage Passersby - MediaPost Publications 17 March, 2010
      • What Is Behavioral Targeting - And What It Is Not - ClickZ News 17 March, 2010
      • Towards a Bill of Rights for Online Advertisers - Huffington Post (blog) 16 March, 2010
      • Who Owns The Privacy? - Mediapost.com 12 March, 2010
    • RSS Adotas

      • Yahoo! Wants to Get More Personal 17 March, 2010
      • Rebranded Image Space Media Revamps Pub Interface 16 March, 2010
      • Developers Digging Windows Phone; Microsoft Employees Still Love iPhones 16 March, 2010
    • RSS MarketingVox

      • @anywhere Complicates Metrics for Twitter Marketing Success 17 March, 2010
      • PointRoll Builds on Trend of Marrying Ads, Editorial 17 March, 2010
      • New Ad Opps Abound at Airports, in the Air 17 March, 2010
    • RSS ExchangeWire.com

      • EBuddy Announces Seven-Figure Deal With InMobi; Rubicon Moves In To The French Market 17 March, 2010
      • Janneke Niessen: The Current Yield Optimisers Will Evolve Into True SSPs 16 March, 2010
      • How Online Advertising Really Works In Europe; Real-Time Bidding Best Practices Whitepaper 12 March, 2010
    • RSS SimsCity blog

      • Attaching pixels to pages 2 January, 2009
      • Frequency capping 28 December, 2008
      • ITV player 27 December, 2008
    • RSS Donald Hamilton

      • Never a True Word said with an “F” 1 December, 2009
      • Whose audience is it anyway? 19 October, 2009
      • Online ad spending bucks trends 29 September, 2008
    • RSS Segmentacion por comportamiento

      • La “Santa Alianza” contra Google. 18 February, 2010
      • Torsten Ahlers, CEO de wunderloop, en el OMExpo2010 26 January, 2010
      • Lanzamiento de la Alianza de editores en Alemania, con la tecnología de wunderloop como motor. 26 January, 2010
    • RSS Sandlines

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

      • DMEXCO Premiere war erfolgreich / Topthema Targeting 6 October, 2009
      • Mit „Behavioral“ den optimalen Werbe-Weg finden 8 May, 2009
      • Mit ToDo und Toodledo das Chaos beherschen 6 May, 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

      51,382 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