Urlopen error errno 3 temporary failure in name resolution

🛠️ Как решить ошибку «Temporary failure in name resolution» Иногда, когда вы пытаетесь проверить связь с веб-сайтом, обновить систему или выполнить какую-либо задачу, требующую активного подключения к Интернету, вы можете получить сообщение об ошибке “temporary failure in name resolution” на вашем терминале. Например, когда вы пытаетесь проверить связь с веб-сайтом, вы можете столкнуться с […]

Содержание

  1. 🛠️ Как решить ошибку «Temporary failure in name resolution»
  2. 1. Отсутствующий или неправильно настроенный файл resolv.conf
  3. 2. Ограничения межсетевого экрана
  4. Для брандмауэра UFW (Ubuntu / Debian и Mint)
  5. urllib.error.URLError: ` #71
  6. Comments
  7. ошибка urlopen error (-3, ‘Temporary failure in name resolution’)
  8. Support Questions
  9. unixforum.org
  10. ошибка urlopen error (-3, ‘Temporary failure in name resolution’) (настроил resolv.conf и iptables)
  11. ошибка urlopen error (-3, ‘Temporary failure in name resolution’)
  12. Re: ошибка urlopen error (-3, ‘Temporary failure in name resolution’)

🛠️ Как решить ошибку «Temporary failure in name resolution»

Иногда, когда вы пытаетесь проверить связь с веб-сайтом, обновить систему или выполнить какую-либо задачу, требующую активного подключения к Интернету, вы можете получить сообщение об ошибке “temporary failure in name resolution” на вашем терминале.

Например, когда вы пытаетесь проверить связь с веб-сайтом, вы можете столкнуться с указанной ошибкой:

Обычно это ошибка разрешения имен, которая показывает, что ваш DNS-сервер не может преобразовать доменные имена в соответствующие IP-адреса.

Это может стать серьезной проблемой, поскольку вы не сможете обновлять или даже устанавливать какие-либо программные пакеты в вашей системе Linux.

В этой статье мы рассмотрим некоторые из причин ошибки «temporary failure in name resolution» и решения этой проблемы.

1. Отсутствующий или неправильно настроенный файл resolv.conf

Файл /etc/resolv.conf – это файл конфигурации резолвера в системах Linux.

Он содержит записи DNS, которые помогают вашей системе Linux преобразовывать доменные имена в IP-адреса.

Если этот файл отсутствует или существует, но ошибка разрешения имени все еще возникает, создайте его и добавьте общедоступный DNS-сервер Google, как показано далее:

Сохраните изменения и перезапустите службу systemd-resolved, как показано.

2. Ограничения межсетевого экрана

Если первое решение вам не помогло, значит ограничения брандмауэра могут помешать вам успешно выполнять DNS-запросы.

Проверьте свой брандмауэр и убедитесь, что порт 53 (используется для DNS ) и порт 43 (используется для поиска whois) открыты.

Если порты заблокированы, откройте их следующим образом:

Для брандмауэра UFW (Ubuntu / Debian и Mint)

Чтобы открыть порты 53 и 43 на брандмауэре UFW, выполните следующие команды:

Источник

urllib.error.URLError: ` #71

Ubuntu 16.04.1 LTS 64-bit
Gnome Shell 3.18.5

$ himawaripy
Updating.
Latest version: 2016/08/05 03:30:00 GMT
Offset version: 2016/08/04 11:30:00 GMT

Downloading tiles: 5/16 completedmultiprocessing.pool.RemoteTraceback:
«»»
Traceback (most recent call last):
File «/usr/lib/python3.5/urllib/request.py», line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File «/usr/lib/python3.5/http/client.py», line 1106, in request
self._send_request(method, url, body, headers)
File «/usr/lib/python3.5/http/client.py», line 1151, in _send_request
self.endheaders(body)
File «/usr/lib/python3.5/http/client.py», line 1102, in endheaders
self._send_output(message_body)
File «/usr/lib/python3.5/http/client.py», line 934, in _send_output
self.send(msg)
File «/usr/lib/python3.5/http/client.py», line 877, in send
self.connect()
File «/usr/lib/python3.5/http/client.py», line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File «/usr/lib/python3.5/socket.py», line 693, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File «/usr/lib/python3.5/socket.py», line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «/usr/lib/python3.5/multiprocessing/pool.py», line 119, in worker
result = (True, func(_args, *_kwds))
File «/usr/lib/python3.5/multiprocessing/pool.py», line 44, in mapstar
return list(map(_args))
File «/usr/local/lib/python3.5/dist-packages/himawaripy-1.1-py3.5.egg/himawaripy/himawaripy.py», line 53, in download_chunk
with urlopen(url_format.format(level, width, strftime(«%Y/%m/%d/%H%M%S», latest), x, y)) as tile_w:
File «/usr/lib/python3.5/urllib/request.py», line 163, in urlopen
return opener.open(url, data, timeout)
File «/usr/lib/python3.5/urllib/request.py», line 466, in open
response = self._open(req, data)
File «/usr/lib/python3.5/urllib/request.py», line 484, in _open
‘_open’, req)
File «/usr/lib/python3.5/urllib/request.py», line 444, in _call_chain
result = func(_args)
File «/usr/lib/python3.5/urllib/request.py», line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File «/usr/lib/python3.5/urllib/request.py», line 1256, in do_open
raise URLError(err)
urllib.error.URLError:
«»»

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File «/usr/local/bin/himawaripy», line 9, in
load_entry_point(‘himawaripy==1.1’, ‘console_scripts’, ‘himawaripy’)()
File «/usr/local/lib/python3.5/dist-packages/himawaripy-1.1-py3.5.egg/himawaripy/himawaripy.py», line 88, in main
File «/usr/lib/python3.5/multiprocessing/pool.py», line 260, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File «/usr/lib/python3.5/multiprocessing/pool.py», line 608, in get
raise self._value
urllib.error.URLError:
abumaia@AbuMaia: $ nc himawari8.nict.go.jp 80
abumaia@AbuMaia: $ curl http://himawari8-dl.nict.go.jp/himawari8/img/D531106/latest.json
<«date»:»2016-08-05 03:30:00″,»file»:»PI_H08_20160805_0330_TRC_FLDK_R10_PGPFD.png»>`

The text was updated successfully, but these errors were encountered:

Источник

ошибка urlopen error (-3, ‘Temporary failure in name resolution’)

подскажите в следующем. абсолютно чистая система, только что установленная в ДЦ. настроил resolv.conf — пинг есть. открыл 80 порт в iptables: ================================== *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT — [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp —icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -p 51 -j ACCEPT -A RH-Firewall-1-INPUT -p udp —dport 5353 -d 224.0.0.251 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 21 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 25 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 53 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 110 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 60000:65000 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m udp -p udp —dport 53 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT —reject-with icmp-host-prohibited =========================

перезагрузил /etc/init.d/iptables restart запускаю yum install httpd и получаю http://mirror.yandex.ru/centos/5.4/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. http://centos.candishosting.com.cn/5.4/os/i386/repodata/repomd.xml: [Errno 4] IOError: В чем может быть дело? прошу подсказки.

или selinux (смотри dmesg), или днс недоступен или прибил фаерволом пакетики.

Источник

Support Questions

  • Subscribe to RSS Feed
  • Mark Question as New
  • Mark Question as Read
  • Float this Question for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page

Created on ‎08-12-2016 09:03 AM — edited ‎09-16-2022 03:34 AM

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Host health is concerning at regular intervals. IT gets amber and then green.

I checked /etc/resolv.conf and there we have two name servers listed.

Checking the cloudera agent logs on one of them and i see these errors in the logs. (replaced the hostname with xxx)

Monitor-GenericMonitor throttling_logger ERROR Error fetching metrics at ‘http://xxx:8088/jmx’
Traceback (most recent call last):
File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/monitor/generic/metric_collectors.py», line 200, in _collect_and_parse_and_return
self._adapter.safety_valve))
File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/url_util.py», line 166, in urlopen_with_retry_on_authentication_errors
return function()
File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/monitor/generic/metric_collectors.py», line 217, in _open_url
password=self._password_value)
File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/url_util.py», line 66, in urlopen_with_timeout
return opener.open(url, data, timeout)
File «/usr/lib64/python2.6/urllib2.py», line 391, in open
response = self._open(req, data)
File «/usr/lib64/python2.6/urllib2.py», line 409, in _open
‘_open’, req)
File «/usr/lib64/python2.6/urllib2.py», line 369, in _call_chain
result = func(*args)
File «/usr/lib64/python2.6/urllib2.py», line 1190, in http_open
return self.do_open(httplib.HTTPConnection, req)
File «/usr/lib64/python2.6/urllib2.py», line 1165, in do_open
raise URLError(err)
URLError:

The same time when this test becomes amber then we get these alerts as well.

The health test result for RESOURCE_MANAGER_WEB_METRIC_COLLECTION has become bad: The Cloudera Manager Agent is not able to communicate with this role’s web server.

Источник

unixforum.org

Форум для пользователей UNIX-подобных систем

  • Темы без ответов
  • Активные темы
  • Поиск
  • Статус форума

ошибка urlopen error (-3, ‘Temporary failure in name resolution’) (настроил resolv.conf и iptables)

Модератор: SLEDopit

ошибка urlopen error (-3, ‘Temporary failure in name resolution’)

Сообщение stasbz » 29.12.2009 18:43

подскажите в следующем. абсолютно чистая система, только что установленная в ДЦ.
настроил resolv.conf — пинг есть.
открыл 80 порт в iptables:
================================== *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT — [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp —icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -p 51 -j ACCEPT -A RH-Firewall-1-INPUT -p udp —dport 5353 -d 224.0.0.251 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 21 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 25 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 53 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 80 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 110 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 60000:65000 -j ACCEPT -A RH-Firewall-1-INPUT -m state —state NEW -m udp -p udp —dport 53 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT —reject-with icmp-host-prohibited =========================

перезагрузил /etc/init.d/iptables restart
запускаю yum install httpd и получаю
http://mirror.yandex.ru/centos/5.4/os/i386. ata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. http://centos.candishosting.com.cn/5.4/os/. ata/repomd.xml: [Errno 4] IOError:
В чем может быть дело? прошу подсказки.

Re: ошибка urlopen error (-3, ‘Temporary failure in name resolution’)

Сообщение stasbz » 29.12.2009 19:50

Источник

Ubuntu 16.04.1 LTS 64-bit
Gnome Shell 3.18.5

`abumaia@AbuMaia:~$ himawaripy
Updating…
Latest version: 2016/08/05 03:30:00 GMT
Offset version: 2016/08/04 11:30:00 GMT

Downloading tiles: 5/16 completedmultiprocessing.pool.RemoteTraceback:
«»»
Traceback (most recent call last):
File «/usr/lib/python3.5/urllib/request.py», line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File «/usr/lib/python3.5/http/client.py», line 1106, in request
self._send_request(method, url, body, headers)
File «/usr/lib/python3.5/http/client.py», line 1151, in _send_request
self.endheaders(body)
File «/usr/lib/python3.5/http/client.py», line 1102, in endheaders
self._send_output(message_body)
File «/usr/lib/python3.5/http/client.py», line 934, in _send_output
self.send(msg)
File «/usr/lib/python3.5/http/client.py», line 877, in send
self.connect()
File «/usr/lib/python3.5/http/client.py», line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File «/usr/lib/python3.5/socket.py», line 693, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File «/usr/lib/python3.5/socket.py», line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «/usr/lib/python3.5/multiprocessing/pool.py», line 119, in worker
result = (True, func(_args, *_kwds))
File «/usr/lib/python3.5/multiprocessing/pool.py», line 44, in mapstar
return list(map(_args))
File «/usr/local/lib/python3.5/dist-packages/himawaripy-1.1-py3.5.egg/himawaripy/himawaripy.py», line 53, in download_chunk
with urlopen(url_format.format(level, width, strftime(«%Y/%m/%d/%H%M%S», latest), x, y)) as tile_w:
File «/usr/lib/python3.5/urllib/request.py», line 163, in urlopen
return opener.open(url, data, timeout)
File «/usr/lib/python3.5/urllib/request.py», line 466, in open
response = self._open(req, data)
File «/usr/lib/python3.5/urllib/request.py», line 484, in _open
‘_open’, req)
File «/usr/lib/python3.5/urllib/request.py», line 444, in _call_chain
result = func(_args)
File «/usr/lib/python3.5/urllib/request.py», line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File «/usr/lib/python3.5/urllib/request.py», line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
«»»

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File «/usr/local/bin/himawaripy», line 9, in
load_entry_point(‘himawaripy==1.1’, ‘console_scripts’, ‘himawaripy’)()
File «/usr/local/lib/python3.5/dist-packages/himawaripy-1.1-py3.5.egg/himawaripy/himawaripy.py», line 88, in main
File «/usr/lib/python3.5/multiprocessing/pool.py», line 260, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File «/usr/lib/python3.5/multiprocessing/pool.py», line 608, in get
raise self._value
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
abumaia@AbuMaia:$ nc himawari8.nict.go.jp 80
abumaia@AbuMaia:$ curl http://himawari8-dl.nict.go.jp/himawari8/img/D531106/latest.json
{«date»:»2016-08-05 03:30:00″,»file»:»PI_H08_20160805_0330_TRC_FLDK_R10_PGPFD.png»}`

Host health is concerning at regular intervals. IT gets amber and then green.

  • The hostname and canonical name for this host are consistent when checked from a Java process. The most recent DNS resolution took 5 second(s). Warning threshold: 1 second(s).

I checked /etc/resolv.conf and there we have two name servers listed.

Checking the cloudera agent logs on one of them and i see these errors in the logs. (replaced the hostname with xxx)

Monitor-GenericMonitor throttling_logger ERROR    Error fetching metrics at ‘http://xxx:8088/jmx’
Traceback (most recent call last):
  File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/monitor/generic/metric_collectors.py», line 200, in _collect_and_parse_and_return
    self._adapter.safety_valve))
  File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/url_util.py», line 166, in urlopen_with_retry_on_authentication_errors
    return function()
  File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/monitor/generic/metric_collectors.py», line 217, in _open_url
    password=self._password_value)
  File «/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.7.1-py2.6.egg/cmf/url_util.py», line 66, in urlopen_with_timeout
    return opener.open(url, data, timeout)
  File «/usr/lib64/python2.6/urllib2.py», line 391, in open
    response = self._open(req, data)
  File «/usr/lib64/python2.6/urllib2.py», line 409, in _open
    ‘_open’, req)
  File «/usr/lib64/python2.6/urllib2.py», line 369, in _call_chain
    result = func(*args)
  File «/usr/lib64/python2.6/urllib2.py», line 1190, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File «/usr/lib64/python2.6/urllib2.py», line 1165, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

The same time when this test becomes amber then we get these alerts as well.

The health test result for RESOURCE_MANAGER_WEB_METRIC_COLLECTION has become bad: The Cloudera Manager Agent is not able to communicate with this role’s web server.

Running Ubuntu on WSL and trying to push to github and download new python modules using pip and I get this error.

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9d654fe0b8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/

I had a look at the resolv.conf file and maybe its corrupted as it just gives a few lines of @@@. Anyone got any ideas how to fix this?

When I run l

ls -al /etc/resolv.conf
-rw-r--r-- 1 root root 261 Nov 28 12:54 /etc/resolv.conf

Update:

I managed to fix the problem. Needed to edit the file and add a line like this:

nameserver 8.8.8.8

Tejes's user avatar

asked Nov 28, 2019 at 18:10

m_bash's user avatar

8

  1. Inside WSL2, create or append file: /etc/wsl.conf

  2. Put the following lines in the file in order to ensure the your DNS changes do not get blown away

    sudo tee /etc/wsl.conf << EOF
    [network]
    generateResolvConf = false
    EOF
    
  3. In a cmd window (!!), run wsl --shutdown

  4. Start WSL2

  5. Run the following inside WSL2 (line with search is optional)

    sudo rm -rf /etc/resolv.conf
    sudo tee /etc/resolv.conf << EOF
    search yourbase.domain.local
    nameserver 8.8.8.8
    nameserver 1.1.1.1
    EOF
    

answered Apr 7, 2022 at 10:02

mati kepa's user avatar

mati kepamati kepa

5665 silver badges6 bronze badges

7

I have the same problem. It also seems to be realted to VPN.
I found out, that it only fails the DNS lookup when I first connect the VPN before starting WSL-Ubuntu after System-Reboot. First starting WSL-Ubuntu and afterwards connecting the VPN seems to work.

answered Aug 6, 2020 at 10:04

Tobias2070's user avatar

Tobias2070Tobias2070

1011 silver badge2 bronze badges

2

For me it was a simple fix. From powershell:

wsl --shutdown

And then restart wsl and it worked. Yes, I know this solution is too simple and might not be good to you if trying to avoid reset to WSL. But in case you look for something simple, maybe worth trying

answered Aug 15, 2021 at 9:51

justadev's user avatar

justadevjustadev

2235 silver badges9 bronze badges

I had the same error. Pinging IP addresses worked, but no DNS resolution. Outside of WSL everything was fine. The problem was caused by OpenVPN for me, when I disconnected from my workplace’s VPN, the error was gone.

answered Jul 15, 2020 at 14:44

Tejes's user avatar

TejesTejes

336 bronze badges

2

I’ve had this issue random on multiple machines, old / new / W10 / W11. In my case if I turn off the Windows Defender Firewall -> DNS resolution works fine from WSL.
Turning it back on and logging packet drops shows the issue at the public network profile:

#Version: 1.5
#Software: Microsoft Windows Firewall
#Time Format: Local
#Fields: date time action protocol src-ip dst-ip src-port dst-port size tcpflags tcpsyn tcpack tcpwin icmptype icmpcode info path
2022-02-01 20:30:34 DROP UDP 172.30.230.159 172.30.224.1 29101 53 45 - - - - - - - RECEIVE
2022-02-01 20:30:35 DROP UDP 172.30.230.159 172.30.224.1 18103 53 45 - - - - - - - RECEIVE

I fixed it by setting an inbound firewall rule for the WSL network adapter — run this in Powershell:
New-NetFirewallRule -DisplayName "WSL allow in" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow

answered Apr 25, 2022 at 18:44

ElektronenVolt's user avatar

1

When I ran ls -lah /etc/resolv.conf, I saw that it was a symlink to ../run/resolvconf/resolv.conf.

But then I noticed that ../run/resolvconf/resolv.conf didn’t exist, and in fact, although the /run/ directory existed, /run/resolvconf/ did not.

So I created that directory and also created an empty file sudo vim /run/resolvconf/resolv.conf.

Then I edited that file to contain:

nameserver 1.1.1.1

After saving that file, ping google.com worked!

(It seems like that file is required. I don’t know how mine got removed.)

https://github.com/microsoft/WSL/issues/6601 was helpful for me.

answered Jul 21, 2021 at 15:56

Ryan's user avatar

RyanRyan

2191 gold badge3 silver badges19 bronze badges

The fix for resolv.conf by @matson kepson deals with DNS. If you can’t ping IP addresses, the problem may be either in the firewall or in the VPN. You can fix it in Administrator’s powershell.

Deal with the firewall, as @ElektronenVolt wrote:

New-NetFirewallRule -DisplayName "WSL allow in" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow

Or with a sledgehammer:

Set-NetFirewallProfile -DisabledInterfaceAliases "vEthernet (WSL)"

Deal with the VPN:

Get-NetIPInterface -InterfaceAlias "vEthernet (WSL)" | Set-NetIPInterface -InterfaceMetric 1
Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect"} | Set-NetIPInterface -InterfaceMetric 6000

The VPN in my case was a company VPN using Cisco AnyConnect. I needed the resolv.conf fix too.

Terminate the Linux VM before starting it again before you test the new settings:

wsl --shutdown

answered Jun 28, 2022 at 17:45

Ferdinand Prantl's user avatar

1

Понравилась статья? Поделить с друзьями:
  • Upload низкий как исправить
  • Upload test error что делать speedtest
  • Upload test error перевод
  • Upload file error 500
  • Upload file data error there is no uploaded file associated with the given key