Unable to resolve host error when using sudo in Debian WSL
1
vote
1
answer
47
views
I was trying to update my packages
sudo apt update; sudo apt upgrade
on a newly created WSL Debian instance but all of the requests to get new repositories failed with this error.
sudo: unable to resolve host Desktop-Dell: Temporary failure in name resolution
Afterwards, apt returned Failed to fetch
I am using a Inspiron 16 Plus 7630 and installing Debian 12 Bookworm
I installed Debian by running wsl --install -d Debian
I tried modifying /etc/hosts
and /etc/hostnames
(I used nano to modify the files) to include my computer's hostname but instead it triggered the safe mode of WSL which disabled some features but I was still getting the same error as before. I also tried reinstalling WSL and Debian but nothing worked.
/etc/hosts
127.0.1.1 Desktop-Dell
/etc/hostname
DESKTOP-DELL
I followed online guides to change these two files and reboot to resolve the host.
[AskUbuntu](https://askubuntu.com/questions/59458/error-message-sudo-unable-to-resolve-host-none)
**I can't update my apt repositories or access the internet. What steps could I take to resolve the host and fix the internet problem? Is this a problem with the naming of the hostname or is it a problem which requires a system reinstall or a problem with WSL and not with Debian?**
Asked by WilliamH25
(21 rep)
Jul 22, 2025, 08:46 AM
Last activity: Jul 23, 2025, 01:01 AM
Last activity: Jul 23, 2025, 01:01 AM