`sudo nix-channel --update` reports 'Couldn't resolve host name'

I am using Nixos WSL currently. It worked fine for a while before, but recently I suddenly found that network requests from nixos itself (such as downloading files when sudo nixos-rebuild switch, or sudo nix-channel update) cannot resolve the hostname.

$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-23.11
nixos-wsl https://github.com/nix-community/NixOS-WSL/archive/refs/heads/main.tar.gz
$ sudo nix-channel --update
warning: error: unable to download 'https://nixos.org/channels/nixos-23.11': Couldn't resolve host name (6); retrying in 259 ms

But I can download the corresponding files directly through wget without any problems. I want to know if there is any difference between downloading from nixos and downloading through wget that causes this to happen?

$ wget https://nixos.org/channels/nixos-23.11
--2024-06-29 06:12:48--  https://nixos.org/channels/nixos-23.11
Connecting to 127.0.0.1:7890... connected.
Proxy request sent, awaiting response... 302 Found
Location: https://channels.nixos.org/nixos-23.11 [following]
--2024-06-29 06:12:49--  https://channels.nixos.org/nixos-23.11
Connecting to 127.0.0.1:7890... connected.
Proxy request sent, awaiting response... 302 Moved Permanently
Location: https://releases.nixos.org/nixos/23.11/nixos-23.11.7714.90bd1b26e237 [following]
--2024-06-29 06:12:50--  https://releases.nixos.org/nixos/23.11/nixos-23.11.7714.90bd1b26e237
Connecting to 127.0.0.1:7890... connected.
Proxy request sent, awaiting response... 200 OK
Length: 4408 (4.3K) [text/html]
Saving to: ‘nixos-23.11’

nixos-23.11                   100%[=================================================>]   4.30K  --.-KB/s    in 0s

2024-06-29 06:12:50 (27.8 MB/s) - ‘nixos-23.11’ saved [4408/4408]