PageSourceSearch

https://adam-coster.pages.dev/_app/immutable/nodes/71.B3pEoPI4.js

js adam-coster.pages.dev collected 2026-10-03 06:27:59 UTC 3,984 bytes, 11 lines download raw bytes

1import{t,a as o}from"../chunks/BRuBKdOt.js";import"../chunks/B4ndRVNs.js";import{e as n}from"../chunks/D3qO8zUI.js";var s=t(`<p>If you're running WSL on Windows and seeing the error message "Temporary failure in name resolution", here's what's going on and how to fix it.</p> <h2 id="verify-the-problem"><a aria-hidden="true" tabindex="-1" href="#verify-the-problem"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Verify the problem</h2> <p>You'll see that error any time a request comes from WSL to the internet. Verify by pinging some website from the WSL terminal, e.g. via <code>ping google.com</code>. If you see that "Temporary failure" error instead of the <code>ping</code> expected data, you've got a DNS resolution problem. But we can fix it.</p> <h2 id="why-is-this-happening"><a aria-hidden="true" tabindex="-1" href="#why-is-this-happening"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Why is this happening?</h2> <p>The WSL configuration file <code>/etc/wsl.conf</code> contains, by default, a setting <code>generateResolvConf = false</code> that is intended to prevent the Linux instance from resetting your DNS resolution settings on each bootup. Unfortunately that setting does <em>not</em> stop the instance from <em>deleting</em> your settings.</p> <p>You can set your DNS resolver manually, but it'll get deleted every time you reboot unless you mark the file as read-only. So that's what we'll do.</p> <h2 id="update-etcresolvconf-and-make-it-read-only"><a aria-hidden="true" tabindex="-1" href="#update-etcresolvconf-and-make-it-read-only"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Update <code>/etc/resolv.conf</code> and make it read-only</h2> <p>Run the following commands in your WSL terminal, changing the nameservers if you feel so inclined:</p> <pre><code class="hljs language-shell"><span class="hljs-meta prompt_"># </span><span class="bash">/etc/resolv.conf is a symbol <span class="hljs-built_in">link</span>, delete it to create a regular file</span>
2sudo rm /etc/resolv.conf
3sudo tee /etc/resolv.conf &#x3C;&#x3C; EOF
4nameserver 1.1.1.1 # Cloudflare
5nameserver 8.8.8.8 # Google
6nameserver 8.8.4.4 # Google
7EOF
8<span class="hljs-meta prompt_">
9# </span><span class="bash">Mark as read-only to prevent deletion on reboot</span>
10sudo chattr +i /etc/resolv.conf
11</code></pre> <p>Thanks to the the <a href="https://github.com/microsoft/WSL/issues/6977">WSL GitHub issue</a> on the topic, and specifically <a href="https://github.com/microsoft/WSL/issues/6977#issuecomment-858716868">the comment</a> by GitHub user <a href="https://github.com/wjzhou">wjzhou</a>, for this answer!</p>`,1);function h(e){var a=s();n(18),o(e,a)}export{h as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.