Article delegate-en/3197 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A3196@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Delegate: Invalid DNS name causes infinite loop
23 Apr 2006 22:43:17 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A3196@delegate-en.ML_> on 04/23/06(02:35:26)
you Snow <pnygabdyi-gztnjk5mfbnr.ml@ml.delegate.org> wrote:
 |If a computer's name has an underscore in it (eg bad_name.domain.co.uk),
 |then resolving it will sometimes cause Delegate to go into an infinite
 |loop and stop answering requests.  The loop doesn't use lots of CPU, but
 |you can see it happening in the the log; maybe it's making requests to
 |itself? It seems to be something to do with IPv6, but there is no IPv6
 |on the network.
 |
 |Delegate runs on the same machine as the client apps and it is setup as
 |the machine's default DNS resolver.

It makes the loop because of you setup the loop as you described.

  query1 -> DeleGate -> query2 -> DeleGate -> ...

I can reproduce the loop it as this:

  (setting 127.0.0.1 as the DNS server of the Windows host)
  > delegated -P53 SERVER=dns RESOLV=dns
  > nslookup _.a 127.0.0.1

This query2 is issued by inet_pton() function which has come to be used
in DeleGate/9.X to cope with IPv6.
In this case, DeleGate uses inet_pton() just to test whether or not
the given character string is an address or not.  But the strange
implementation of inet_pton() in WinSock issues a DNS query fot it,
maybe when the string is not the dot-notation of IPv4 address.
In this case, the DNS server is DeleGate itself, so loop starts.

I think it should be solved by a modification not to use inet_pton() of
WinSock, to escape issueing unnecessary DNS query by DeleGate which can
occur in other than a DeleGate as a DNS server too.
The enclosed patch will be effective to escape your problem for a while.

Cheers,
Yutaka
--
  D G   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


*** ../delegate9.1.1/resolvy/resolv.c	Thu Mar 23 17:47:50 2006
--- resolvy/resolv.c	Mon Apr 24 07:06:07 2006
***************
*** 1427,1432 ****
--- 1427,1436 ----
  		debug(DBG_FORCE,"Skip gethostbyNX(NULL)\n");
  		return NULL;
  	}
+ 	if( strpbrk(name,"_:") ){
+ 		debug(DBG_FORCE,"Skip gethostbyNX(%s) seems not a name\n",name);
+ 		return NULL;
+ 	}
  
  	if( streq(NXDOM,name) ){
  		if( nNXDOM++ == 0 )

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V