Archive for May, 2013

When you run a DNS server on your dedicated server, it will be the target DNS amplification attacks. To prevent these attacks from succeeding and using up your bandwidth (which you will pay for), you need to configure your DNS server not to answer recursive queries.

Check if your server is vulnerable

You can send a DNS query to your server, e.g. “thatserver.dedicated.co.za” using dig or nslookup.

dig @thatserver.dedicated.co.za www.isc.org

Alternatively:

<strong>nslookup</strong>

&gt; server thatserver.dedicated.co.za

&gt; isc.org

Non-authoritative answer:

Name: isc.org

Address: <strong>149.20.64.42</strong>

If you receive an answer that includes an answer of the IP address of www.isc.org, then your server is vulnerable, because it did the work of finding out the answer and presenting it to you.

Secure Microsoft DNS server

If you have installed or enabled Exchange then you have implicitly turned on DNS, which by default runs as a recursive service and can be horribly attacked. Usually you can just firewall the DNS service.

Unfortunately, it is not possible to prevent the Microsoft DNS server from replying with cached values, so your non-recursive DNS server will provide a small amount of useful traffic amplification for attackers. Where possible, add a firewall rule that blocks incoming traffic from unauthorised clients towards port 53/UDP (and port 53/TCP for good measure).

iptables rules for Linux

If your DNS server is used only by the machine on which you are running it, you can block external queries as follows:

iptables -A INPUT -p udp -m udp --dport 53 -i ! lo -j DROP

These iptables firewall rules will to prohibit excessive ANY queries to a non-recursive DNS: