How to use "dns_new()" (I get "dns_new: Assertion `(copy->dnsc_flags & DNS_INITED)' failed")

Michael Tokarev mjt at tls.msk.ru
Sat Feb 5 21:24:04 MSK 2011


05.02.2011 21:13, Iñaki Baz Castillo wrote:
[]
>> However, even without the fix, it should not time out -
>> unless it produces really bogus queries.  Which queries
>> it performs?
> 
> - First it sends a correct DNS A query to DNS server 1.
> - Server 1 replies "0011 No such name".
> - udns then sends a malformed query to server 1 (no reply).

And that explains things.  Yes, that's the mentioned bug.
When the query is malformed, your recursive nameserver
just ignores it, but since udns does not receive any
reply it retries again up to configured number of attempts
and gives up only after that.  Note it does name search
based on your domain - trying to append local domain to
non-absolute names.

> - Then to server 2.
> - Then to server 1.
> - Then to server 2.
> - And so on...
> - After ~30 seconds it ends with error NXDOMAIN.
> 
> I attach a full network capture (I query "aliax.nettt" which doesn't
> exist). My DNS servers in resolv.conf are 8.8.8.8 and 8.8.4.4.

By the way, you may prefer to actually run some caching
nameserver locally, such as already mentioned unbound -
it's trivial to set up, just install it, configure
forwarders, and specify it in your resolv.conf as 127.0.0.1.

> PS: If you prefer the tcpdump binary capture ask it to me please.

No need really, that's the bug in question.

Note that this "special context" thing hasn't been in use,
unlike all other parts of the library.  Usually an application
does not care about additional contexts, using the default
one.  But dnsget uses it sometimes, if non-default nameserver
is specified.

/mjt


More information about the udns mailing list