so I was having issues with domain resolution with WSL whenever I use the VPN. I would get this:
ping: google.com: Temporary failure in name resolution
I tried following instructions from these answers Temporary Failure in name resolution on WSL
Specifically from this part:
Inside WSL2, create or append file: /etc/wsl.conf
Put the following lines in the file in order to ensure the your DNS changes do not get blown away
echo "[network]" | sudo tee /etc/wsl.conf
echo "generateResolvConf = false" | sudo tee -a /etc/wsl.conf
In a cmd window, run
wsl --shutdown
Start WSL2
Run the following inside WSL2
sudo rm -rf /etc/resolv.conf
sudo cat << EOF > /etc/resolv.conf
search [yourbase.domain.local]
nameserver 8.8.8.8
nameserver 1.1.1.1
EOF
However, I cannot seem to be able to edit the file /etc/resolv.conf as I would get zsh: permission denied: /etc/resolv.conf
I also don't know what it means [yourbase.domain.local] or with what I should be replacing it. I already messed up my domain resolution, and now I get the first error every time, even when my laptop is not connected to the VPN. I really need to know how to fix the config files that I modified
Edit: using muru's suggestion from the comments, I was able to fix the domain resolution with the command
sudo tee /etc/resolv.conf <<EOF
However, I'd like to know if there is a solution for this error when I connect to a VPN. Since none of the solutions from the mentioned link didn't work for me.