Share via

Sporadic but frequent DNS failures in Firefox and PowerShell: System.Net.Sockets.SocketException 0x00002AFA

Mark Renton 115 Reputation points
2025-08-19T09:12:36.1466667+00:00

Since I upgraded to Windows 11 PC I have been getting errors loading websites in Firefox.

"Hmm... we're having trouble finding that site", usually on l.facebook.com (used to record Facebook clicks and redirect them) but on other sites too.

So I wrote a PowerShell function to loop on doing [System.Net.DNS]::resolve("l.facebook.com") every 5 seconds until it gets an error, and the error it sometimes (every few thousand attempts) gets is the following (note the InnerException)...

ErrorRecord : Exception calling "Resolve" with "1" argument(s): "This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server."

WasThrownFromThrowStatement : False

TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception)

Message : Exception calling "Resolve" with "1" argument(s): "This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server."

Data : {}

InnerException : System.Net.Sockets.SocketException (0x00002AFA): This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.

                             at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, Nullable`1 activityOrDefault)

                             at System.Net.Dns.Resolve(String hostName)

                             at CallSite.Target(Closure, CallSite, Type, Object)

HelpLink :

Source : System.Management.Automation

HResult : -2146233087

StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)

                             at lambda_method463(Closure, Object[], StrongBox`1[], InterpretedFrame)

The HResult in hex is 0x80131501

Firefox is my default browser, so I haven't tested whether or not Edge gets similar errors.

This happened very infrequently on Windows 10. How do I fix it?

Windows for home | Windows 11 | Internet and connectivity
0 comments No comments

Answer accepted by question author

Lychee-Ng 20,870 Reputation points Microsoft External Staff Moderator
2025-08-19T14:46:54.6666667+00:00

Hi Mark Renton,

Welcome to Microsoft Q&A!

Thank you for sharing the detailed error message and context! The issue you described can be tricky, especially when it happens random but frequent, affecting your performance. This seems to be a classic DNS resolution issue on Windows 11, typically indicating that your system is not receiving timely responses from the configured DNS server, which can result from several underlying causes. Here is something you can try to improve the situation:

1 - Flush DNS and reset Network Stack

  • Open Command Prompt as Admin > run these prompts one by one:
    • ipconfig /flushdns
    • ipconfig /registerdns
    • netsh int ip reset
    • netsh winsock reset
  • Or if you prefer PowerShell > run this:
    • Clear-DnsClientCache
    • ipconfig /flushdns
  • Restart your computer after this.

2 - Temporary disable IPv6 (if possible)

  • Press Win + R > type ncpa.cpl > Open Network Connections
  • Right-click your active adapter > Properties
  • Uncheck Internet Protocol Version 6 (TCP/IPv6)

3 - Switch to a more reliable DNS provider

  • Go to Settings > Network & Internet > Ethernet/Wi-Fi
  • Expand your adapter > DNS server assignment > Edit
  • Set to Manual, enable IPv4:
    • For Google: 8.8.8.8 & 8.8.4.4
    • For Cloudflare: 1.1.1.1 & 1.0.0.1
  • Repeat for IPv6 if needed.

If the issue persists after applying the above fixes, consider checking the following:

  1. Disable VPNs or firewalls to test: They can sometimes intercept DNS requests.
  2. Update network drivers in Device Manager: Outdated or buggy drivers can cause DNS failures.
  3. Temporarily stop the DNS Client service.
  4. Test in Edge or Chrome to isolate whether Firefox is contributing to the issue. If they work consistently, Firefox may need a network settings reset.

Let me know if you'd like help with any of these steps. I can also share a guide on how to update network drivers and stop DNS Client service. If the fluctuations are consistent, there's also a chance that it comes directly from your Internet line - consider calling and checking with the provider in that case!


If the answer is helpful, please click "Accept Answer" and kindly upvote it to assist others who might face similar issues. If you have extra questions, please click "Comment".

Note: To enable e-mail notifications, follow the steps in our documentation!

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.