Security – Is the dns server being attacked? And what should I do about it

domain-name-systemlog-filesSecurity

I've been having some intermittent dns problems with a web server, where certain isp's dns servers don't have my hostnames in cache and fail to look them up. At the same time, queries to opendns for those hostnames resolve correctly. It's intermittent, and it always works fine for me, so it's hard to identify the problem when someone reports connectivity problems to my site.

In trying to figure this out, I've been looking at my logs to see if there are any errors I should know about.

I found thousands of the following messages in my logs, from different ip's, but all requesting similar dns records:

May 12 11:42:13 localhost named[26399]: client 94.76.107.2#36141: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:42:13 localhost named[26399]: client 94.76.107.2#29075: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:42:13 localhost named[26399]: client 94.76.107.2#47924: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:42:13 localhost named[26399]: client 94.76.107.2#4727: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:42:14 localhost named[26399]: client 94.76.107.2#16153: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:42:14 localhost named[26399]: client 94.76.107.2#40267: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:43:35 localhost named[26399]: client 82.209.240.241#63507: query (cache) 'burningpianos.com/MX/IN' denied
May 12 11:43:35 localhost named[26399]: client 82.209.240.241#63721: query (cache) 'burningpianos.org/MX/IN' denied
May 12 11:43:36 localhost named[26399]: client 82.209.240.241#3537: query (cache) 'burningpianos.com/MX/IN' denied

I've read of Dan Kaminsky's dns cache poisoning vulnerability (http://unixwiz.net/techtips/iguide-kaminsky-dns-vuln.html), and I'm wondering if these log records are an attempt by some evildoer to attack my dns server.

There are thousands of records in my logs, all requesting "burningpianos", some for com and some for org, most looking for an mx record. There are requests from multiple ip's, but each ip will request hundreds of times per day.

So this smells to me like an attack. What is the defense against this?

Best Answer

I can't tell you for certain what it is, but I can tell you what it isn't:

  1. It isn't a Kaminsky / cache poisoning attack.
    • Kaminsky attacks require a random "nonce" on the front of the queried domain name
    • Your server is authoritative, not caching
  2. It's not high enough volume to be a reflection attack against the third party IP addresses

For what it's worth, I think this is misconfiguration of those domains, although from here they appear to be offline. I can see some inconsistencies in the glue records for burningpianos.com - the .com servers say that they're 209.97.196.66 and .67 - is that you?

Contrary to Brad's suggestion, I would say that if possible you should actually configure your server to return a REFUSED response to queries for these domain names.

Simply dropping the queries means that the clients at the other side will continue to retry, as appears to be happening already.

If the traffic drops when you do that, it straight away tells you that the source addresses are not spoofed, and that would reinforce the theory that it's misconfiguration.