LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Any tool to compare DNS results from several DNS servers? (https://www.linuxquestions.org/questions/linux-networking-3/any-tool-to-compare-dns-results-from-several-dns-servers-770338/)

Ulysses_ 11-19-2009 07:52 PM

Any tool to compare DNS results from several DNS servers?
 
Someone suggested what he called "dns pooling" as a countermeasure for those man-in-the-middle attacks that are based on DNS poisoning. His suggestion was to query several DNS servers and compare the results. If there's any difference, alert the user. Of course that would produce false alarms for any legitimate IP changes propagating in DNS networks. But it's better than nothing.

Are there any tools to automatically compare the results from several DNS servers, and alert for any difference?

Guyverix 11-20-2009 06:03 AM

Hmm, that is an interesting idea. The script at http://www.madboa.com/geek/dig/
has about 80-90% of the code done that would be needed. just reverse what is in the text file vs what is being queried.

Jim Bengtson 11-20-2009 07:48 AM

Quote:

Originally Posted by Guyverix (Post 3763749)
Hmm, that is an interesting idea. The script at http://www.madboa.com/geek/dig/
has about 80-90% of the code done that would be needed. just reverse what is in the text file vs what is being queried.

As an enhancement, if all DNS servers in your pool agree on an entry, use it. If 90% (or whatever threshhold you set) agree, use it. If less than that threshhold agree, put it in a file for a human admin to check. Or perhaps find some way to record whether anyone on the network have requested that domain recently, and flag it for a human to respond to, and ignore those that no one has requested recently.

But if someone then does request one of those questionable domains, what then?

Ulysses_ 11-20-2009 01:12 PM

That's good. Any chance we could force all accesses to the internet from browsers, email clients etc, go through this check? Where would the script go, what system scripts would be edited?

Guyverix 11-22-2009 03:33 AM

Quote:

Originally Posted by Ulysses_ (Post 3764198)
That's good. Any chance we could force all accesses to the internet from browsers, email clients etc, go through this check? Where would the script go, what system scripts would be edited?

That kind of script used in the fashion you are asking about would have to go on your local DNS server. To be honest however I do not believe it would be robust enough to work really well. Especially if you are checking all outgoing DNS queries.. The script would have to edit your local DNS server cache as well. I believe that you would have all kinds of headaches doing this (although I dont pretend to be a DNS expert)..

Ulysses_ 11-22-2009 11:42 AM

Isn't it simpler to find the place in the system scripts where the 2 DNS servers that you specify with the gnome network manager are read and used one at a time, with the second one being read only if the first one fails? It would then be a very simple change of the script, to ask both DNS servers anyway, and also ask 5 more servers, and return successfully only if they all agree?

Jim Bengtson 11-22-2009 05:01 PM

Quote:

Originally Posted by Ulysses_ (Post 3765870)
Isn't it simpler to find the place in the system scripts where the 2 DNS servers that you specify with the gnome network manager are read and used one at a time, with the second one being read only if the first one fails? It would then be a very simple change of the script, to ask both DNS servers anyway, and also ask 5 more servers, and return successfully only if they all agree?

How would you know if the first one failed? The idea here is to combat DNS poisoning, where a DNS server is intentionally given the wrong IP address for a site. How do you know the DNS server has been poisoned? By comparing it's answers against several other DNS servers to see if they all give the same answer.

Ulysses_ 11-22-2009 05:08 PM

Quote:

Originally Posted by Jim Bengtson (Post 3766087)
How would you know if the first one failed?

I said you check them both and compare them. The bit about the first server failing etc was the description of what is currently going on in the linux scripts we want to edit (it fails if there's no dns server running at the address given).

Jim Bengtson 11-22-2009 05:14 PM

Quote:

Originally Posted by Ulysses_ (Post 3766093)
I said you check them both and compare them. The bit about the first server failing etc was the description of what is currently going on in the linux scripts we want to edit (it fails if there's no dns server running at the address given).

But what if there is a DNS server running there, and it does give an IP address in response to a name query, but that IP address is wrong (i.e., it has been poisoned)?

Only by performing the same DNS query against multiple DNS servers would you have a reasonable chance of detecting the poisoning.

Ulysses_ 11-22-2009 05:21 PM

Quote:

Originally Posted by Jim Bengtson (Post 3766097)
But what if there is a DNS server running there, and it does give an IP address in response to a name query, but that IP address is wrong (i.e., it has been poisoned)?

Then you start an LQ thread about this thing you saw online somewhere that is called DNS pooling (see OP).

Jim Bengtson 11-22-2009 06:43 PM

Quote:

Originally Posted by Ulysses_ (Post 3766103)
Then you start an LQ thread about this thing you saw online somewhere that is called DNS pooling (see OP).

I agree...but this suggestion

Quote:

Isn't it simpler to find the place in the system scripts where the 2 DNS servers that you specify with the gnome network manager are read and used one at a time, with the second one being read only if the first one fails?
won't work because the first DNS query is successful...it returns a result. You just won't know if it's a poisonous result or not. That's the danger of DNS poisoning attacks...you trust the DNS server yet have no way to validate that trust.

Ulysses_ 11-24-2009 10:52 AM

You still do not understand the suggestion. The suggestion is to edit a computer program, part of the linux system and probably a script, that currently does the wrong thing, and the wrong thing that it does was described here:
Quote:

the 2 DNS servers that you specify with the gnome network manager are read and used one at a time, with the second one being read only if the first one fails?
The desired thing that we want was described here:
Quote:

ask both DNS servers anyway, and also ask 5 more servers, and return successfully only if they all agree?

Ulysses_ 11-24-2009 10:54 AM

Now does anyone know where linux implements the access to the list of DNS servers that you have specified with the gnome network manager, before querying the servers one at a time?

It should be an extremely simple change if linux does it with a script.

davidzake 11-04-2010 03:36 PM

Hi,
You can compare DNS records at-

http://sharontools.com

Happy to help,
Dave


All times are GMT -5. The time now is 03:30 PM.