View Issue Details

IDProjectCategoryView StatusLast Update
0001987unrealircdpublic2004-07-22 17:19
ReporterslePP Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
Product Version3.2-RC2 
Summary0001987: [patch] Reverse DNS -> Name -> IP using T_ANY does not work properly with dnscache
DescriptionWhen using djbdns' dnscache (perhaps others), when placing a query for T_ANY to it, it will respond with nothing but information it knows to be authoritative. Notably, this is the list of name servers for a zone, and perhaps not even that sometimes.

This bug only happens when INET6 is enabled at compile time, as it changes a number of DNS queries to use T_ANY instead of more specific items.

This patch adds two new functions to res.c which are only used when a PTR response has been received from a server. It then looks at the IP type it was asking for (IPv6 or IPv4) and calls the resolver routines (do_revquery_name and gethost_byname_revquery) with a flag telling them if it is IPv4 or IPv6 it should be looking for.

It will then only look for a name -> IPv6 or name -> IPv4 mapping if the original reverse DNS lookup was IPv6 or IPv4 respectively.

This patch is now in use on 4 servers on irc.spod.ca, if anyone cares to test it out on a live network. Until these changes were made, no reverse DNS worked at all for any of the connections.
Steps To Reproduce1. Install djbdns' dnscache.
2. Make Unreal use it as a name server.
3. Connect. You'll get nothing.
4. Apply patch.
5. Recompile, restart.
6. Connect. You'll get reverse DNS on both IPv6 and IPv4 depending on connect method.
Additional Information[patch for issue in 0001252 {dup]]
Attached Files
unreal32rc2-dns-revquery.patch (3,453 bytes)
3rd party modules

Activities

slePP

2004-07-22 08:50

reporter   ~0007208

I know this isn't against the latest releases, but I do think this is a rather latent bug. Systems using BIND as a name server will work fine with or without this patch, since BIND returns a lot of information as an authority when it should not.

This patch is also available at http://www.spod.ca/patches/unreal32rc2-dns-revquery.patch

This patch also makes no changes to the existing do_query_name and gethost_byname functions to remain completely compatible.

stskeeps

2004-07-22 08:53

reporter   ~0007209

I think this is the more proper way to do IPv6 reverse lookups, imho, we should think about applying this.

slePP

2004-07-22 08:54

reporter   ~0007210

I agree. Hehe.

Using T_ANY is kind of hackish, since it returns absolutely everything, increasing DNS load and traffic when it really isn't needed. What we're truly looking for on a ip -> name -> ip map is that they are connecting from a host with the same ip as their reverse name. Looking up anything else _but_ the type they're connected from just opens us up for more problems.

syzop

2004-07-22 10:32

administrator   ~0007211

Thanks! This is the patch for 0001252, I'll certainly take a look at it when I got some time (=soon).

syzop

2004-07-22 17:19

administrator   ~0007221

Thanks, fixed in CVS [.109].
If you have any questions, feel free to contact me directly at [email protected]

Issue History

Date Modified Username Field Change
2004-07-22 08:47 slePP New Issue
2004-07-22 08:47 slePP File Added: unreal32rc2-dns-revquery.patch
2004-07-22 08:50 slePP Note Added: 0007208
2004-07-22 08:53 stskeeps Note Added: 0007209
2004-07-22 08:54 slePP Note Added: 0007210
2004-07-22 10:32 syzop Note Added: 0007211
2004-07-22 10:34 syzop Assigned To => syzop
2004-07-22 10:34 syzop Status new => acknowledged
2004-07-22 10:34 syzop ETA none => < 1 week
2004-07-22 10:34 syzop Additional Information Updated
2004-07-22 17:19 syzop Status acknowledged => closed
2004-07-22 17:19 syzop Note Added: 0007221