当我无法解析域时,如何能够浏览网页?

Aus*_*pex 10 linux networking

我的网络显然是 bollixed,但我不知道如何:

derek@vinka:~$ nslookup google.com
;; connection timed out; no servers could be reached

derek@vinka:~$ curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
Run Code Online (Sandbox Code Playgroud)

当然,如果我不能查找域,我就不能浏览到它。任何人都可以解释这里发生了什么吗?

tracepath也只有一长串任???no reply响应。

(FWIW,一切都工作,但我想改变我的二级路由器上的50'以太网电缆连接到电缆调制解调器/路由器,成为在同一子网中的AP,而不是被它自己子网的路由器)

derek@vinka:~$ env | grep -i proxy
derek@vinka:~$ cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       vinka

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

derek@vinka:~$ 

derek@vinka:~$ nslookup
> server
Default server: 127.0.1.1
Address: 127.0.1.1#53
Run Code Online (Sandbox Code Playgroud)

有趣的是,我从一个运行 NetworkManager 的系统和另一个运行 Connmand 的系统得到了相同的结果。

如果我通过我的路由器 ( nslookup host 192.168.0.1)查找,我仍然无法获得任何分辨率,但是 browsers/curl/wget 始终可以在我的笔记本电脑、我的 raspberry Pi 媒体服务器和我的手机上运行——它们都运行不同的操作系统。

/etc/nsswitch 呢?

derek@vinka:~$ grep hosts /etc/nsswitch.conf
hosts:          files mdns4_minimal dns [NOTFOUND=return] resolve [!UNAVAIL=return] dns
Run Code Online (Sandbox Code Playgroud)

显然,最后一个dns是多余的,但它看起来是正确的,否则。

derek@vinka:~$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 127.0.1.1
Run Code Online (Sandbox Code Playgroud)

在我的媒体服务器上:

derek@nas ~ $ cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 127.0.0.1
Run Code Online (Sandbox Code Playgroud)

小智 1

不确定“浏览网络”是什么意思,但 Firefox 正在使用它自己的解析器 - https://developers.cloudflare.com/1.1.1.1/commitment-to-privacy/privacy-policy/firefox/

几乎任何应用程序都可以忽略您的 DNS 设置并使用它自己的解析器。因此,您没有正确设置 DNS 的事实并不能阻止它们。

  • 好吧,正如您从问题中看到的,我所说的“浏览网络”包括使用“curl”。我很确定curl 不够聪明,没有自己的解析器。事实上,我使用了多个浏览器,都得到了相同的结果,但curl最适合在此处呈现结果。尽管如此,这仍然是我所得到的最接近的答案! (2认同)