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

DeliciousFacebookTwitterLinkedInShare/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

    advertising AI apple behavioural-targeting business Computing cPanel deep packet inspection Downloads DSP Games GNU/Linux google hacking hacking Hardware headphones hosting Ideas Instant Messaging iphone marketing 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 ExchangeWire.com

      • The PostView: Are Facebook And Amazon About To Disrupt The Multi-Billion Euro/Dollar Traditional Display Model? 26 January, 2012
      • Adfonic CTO, Wes Biggs, Discusses The Huge Opportunity Around Rich Media Formats In The Mobile Channel 25 January, 2012
      • Retargeting Centralised: Why Agencies Should Internalise This DR Buying Function And How It Would Benefit Advertisers 24 January, 2012
    • RSS Lies, Damned Lies…

      • Building the Perfect Display Ad Performance Dashboard, Part II – metrics 20 December, 2011
      • Should Wikipedia accept advertising? 21 November, 2011
      • Building the Perfect Display Ad Performance Dashboard, Part I – creating a measurement framework 9 November, 2011
    • RSS iMedia Connection: Consumer Strategies

      • A consumer-driven mindset in a big media package
      • Learn to leverage the social-search connection
      • Your social media disaster kit
    • RSS Segmentacion por comportamiento

      • Your Stats Have a New Home 26 January, 2012
      • Reblogging is Back! 22 January, 2012
      • New Theme: Newsy 20 January, 2012
    • RSS Sandlines

      • The Social Phone doesn’t come with an IVR menu 7 November, 2011
      • Are you ready for Big Data? 2 November, 2011
      • Sandlines @ Mediapro 29 October, 2011
    • RSS Adotas

      • Skyfire Lands $8 Million in Funding, Plans to Expand into Europe 25 January, 2012
      • Survey: Younger People Aren’t So Worried About Data Access 25 January, 2012
      • Are You Being Underserved? Overcoming Limitations of Ad Servers 25 January, 2012
    • RSS NMA

      • Facebook urges clearer understanding of social commerce 26 January, 2012
      • McDonald’s admits Twitter campaign failure 25 January, 2012
      • Google to consolidate privacy data to bolster ad targeting 25 January, 2012
    • RSS Brand Republic

      • Surf signs TOWIE sponsorship deal 26 January, 2012
      • Samsung invites customers to shoot Tulisa music video 26 January, 2012
      • MPs to quiz beauty marketers on body confidence 26 January, 2012
    • RSS MarketingVox

      • Closing Bell: Privacy | iPhone to be delivered this summer | Public alerts on Google maps 25 January, 2012
      • The BBB Takes on 4G Claims 25 January, 2012
      • The Art and Science of Using Images in Email Marketing 25 January, 2012
    • RSS Behavioural Targeting news

      • Consumers in the middle of Google-Facebook battle - USA TODAY 26 January, 2012
      • Advertisers to police themselves when targeting online users - Toronto Star 25 January, 2012
      • Zumobi hires former Microsoft director Marla Schimke to lead marketing - TechFlash (blog) 25 January, 2012
      • Garraway's goodypass.com Gets Bigger and Better - San Francisco Chronicle (press release) 25 January, 2012
      • Comparing the Top 4 Retargeting Companies - SEOmoz (blog) 25 January, 2012
    • Ads

    • Blogroll

      • 90kts
      • Acxiom Poker Nights
      • Amy’s blog
      • Bytter’s blog
      • Impare Arquitectura
      • Impare Design
      • 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

      • Banksy
      • Designarte
      • Made to measure shirts – Atelier de Camisa
      • 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

      99,711 spam comments blocked by
      Akismet
    • Meta

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

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