Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Unfortunately, there is no way (of which I am aware) to change this timeout in the Windows API, on the client side. The best you can do is edit the registry to alter the length of the timeouts in DNS queries. See <a href="http://technet.microsoft.com/en-us/library/cc977482.aspx" rel="noreferrer">this technet article</a> for details. To my knowledge, attempts 1, 2, &amp; 3 are run when you do this, hence the 5 second delay.</p> <p>The only other option is to use some form of background processing, such as this <a href="http://www.chapleau.info/cs/blogs/fchapleau/archive/2008/09/09/reverse-dns-lookup-with-timeout-in-c.aspx" rel="noreferrer">asynchronous version</a> of reverse DNS lookups. This is going to use threading, though, so you'll eventually run into the timeouts (it'll be better, since it'll be across many waiting threads, but still not perfect). Personally, if you're going to process a huge number, I'd mix both approaches - do a reverse lookup ansyncrhonously AND modify the registry to make the timeout shorter.</p> <hr> <p>Edit after comments:</p> <p>If you look at the flags on <a href="http://msdn.microsoft.com/en-us/library/ms738532(VS.85).aspx" rel="noreferrer">getnameinfo</a>, there is a flags parameter. I believe you can P/Invoke into this and set the flags <code>NI_NAMEREQD | NI_NUMERICHOST</code> to get the behavior you are after. (The first says to error out immediately if there is no DNS entry, which helps the timeout - the second says to do the reverse lookup.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload