Dns.BeginGetHost… methods blocking

System.Net.Dns uses the windows gethostbyname function for DNS queries and doesn’t really have asynchronous functions at all. The BeginGetHostEntry function is basically just a wrapper for a synchronous GetHostEntry invocation on the thread pool.

Last time I had this same problem with slow/synchronous DNS lookups I eventually just used a large ThreadPool to get the job done since not a single built-in windows or .net DNS related function supports proper (parallel) asynchronous execution.

Leave a Comment