jib*_*eel 1 networking dns 14.04
当我这样做时,ping google.com
我得到ping: unknown host google.com
但是ping 173.194.67.138
我什么时候得到这个:
PING 173.194.67.138 (173.194.67.138) 56(84) bytes of data.
64 bytes from 173.194.67.138: icmp_seq=1 ttl=48 time=5.33 ms
64 bytes from 173.194.67.138: icmp_seq=2 ttl=48 time=5.40 ms
Run Code Online (Sandbox Code Playgroud)
所以在尝试解析 DNS 时肯定有错误,有什么我可以做的吗?
这是来自我的系统日志:
Aug 14 19:55:15 localhost ntpd[1184]: ntpd 4.2.6p5@1.2349-o Mon Apr 13 13:39:46 UTC 2015 (1)
Aug 14 19:55:15 localhost ntpd[1185]: proto: precision = 0.102 usec
Aug 14 19:55:15 localhost ntpd[1185]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Aug 14 19:55:15 localhost ntpd[1185]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Aug 14 19:55:15 localhost ntpd[1185]: Listen and drop on 1 v6wildcard :: UDP 123
Aug 14 19:55:15 localhost ntpd[1185]: Listen normally on 2 lo 127.0.0.1 UDP 123
Aug 14 19:55:15 localhost ntpd[1185]: Listen normally on 3 eth0 108.61.209.172 UDP 123
Aug 14 19:55:15 localhost ntpd[1185]: Listen normally on 4 lo ::1 UDP 123
Aug 14 19:55:15 localhost ntpd[1185]: Listen normally on 5 eth0 fe80::5400:ff:fe10:937 UDP 123
Aug 14 19:55:15 localhost ntpd[1185]: peers refreshed
Aug 14 19:55:15 localhost ntpd[1185]: Listening on routing socket on fd #22 for interface updates
Aug 14 19:55:19 localhost ntpd[1185]: ntpd exiting on signal 15
Aug 14 19:55:29 localhost ntpdate[1216]: Can't find host 1.time.constant.com: Name or service not known (-2)
Aug 14 19:55:39 localhost ntpdate[1216]: Can't find host 2.time.constant.com: Name or service not known (-2)
Aug 14 19:55:49 localhost ntpdate[1216]: Can't find host 3.time.constant.com: Name or service not known (-2)
Aug 14 19:55:49 localhost ntpdate[1216]: no servers can be used, exiting
Aug 14 19:55:49 localhost ntpd[1250]: ntpd 4.2.6p5@1.2349-o Mon Apr 13 13:39:46 UTC 2015 (1)
Aug 14 19:55:49 localhost ntpd[1251]: proto: precision = 0.122 usec
Aug 14 19:55:49 localhost ntpd[1251]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Aug 14 19:55:49 localhost ntpd[1251]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Aug 14 19:55:49 localhost ntpd[1251]: Listen and drop on 1 v6wildcard :: UDP 123
Aug 14 19:55:49 localhost ntpd[1251]: Listen normally on 2 lo 127.0.0.1 UDP 123
Aug 14 19:55:49 localhost ntpd[1251]: Listen normally on 3 eth0 108.61.209.172 UDP 123
Aug 14 19:55:49 localhost ntpd[1251]: Listen normally on 4 lo ::1 UDP 123
Aug 14 19:55:49 localhost ntpd[1251]: Listen normally on 5 eth0 fe80::5400:ff:fe10:937 UDP 123
Aug 14 19:55:49 localhost ntpd[1251]: peers refreshed
Aug 14 19:55:49 localhost ntpd[1251]: Listening on routing socket on fd #22 for interface updates
Aug 14 19:55:59 localhost ntpd[1251]: Deferring DNS for 1.time.constant.com 1
Aug 14 19:56:09 localhost ntpd[1251]: Deferring DNS for 2.time.constant.com 1
Aug 14 19:56:19 localhost ntpd[1251]: Deferring DNS for 3.time.constant.com 1
Aug 14 19:56:19 localhost ntpd[1255]: signal_no_reset: signal 17 had flags 4000000
Aug 14 19:56:31 localhost ntpd_intres[1255]: host name not found: 1.time.constant.com
Aug 14 19:56:41 localhost ntpd_intres[1255]: host name not found: 2.time.constant.com
Aug 14 19:56:51 localhost ntpd_intres[1255]: host name not found: 3.time.constant.com
Run Code Online (Sandbox Code Playgroud)
小智 7
我敢打赌你不能这样做:
nslookup rtfm.mit.edu
Run Code Online (Sandbox Code Playgroud)
但你可以这样做:
nslookup rtfm.mit.edu 8.8.8.8
Run Code Online (Sandbox Code Playgroud)
如果您检查/etc/resolv.conf
文件的内容,它可能是空的,或者将您的 DNS 解析器指向 Ubuntu 无法访问的内容。 /etc/resolv.conf
可以使用任何纯文本编辑器(vim、nano 等)手动配置,或者/etc/network/interfaces
如果您安装了resolvconf
软件包。或者,网络管理器可以管理它并从 DHCP 获取 DNS 服务器信息(如果您的环境正在使用它)。您需要弄清楚您的 Ubuntu 正在使用哪种方法,因为手动进行更正的更改/etc/resolv.conf
将resolvconf
在您下次重新启动或断开网络连接时被覆盖,并且网络管理器喜欢到处乱写。
你不会说这是一台使用以太网的办公机器,一台带 wifi 的家用机器,台式机还是笔记本电脑,以及它有什么样的网络连接。我需要更多关于这些细节的信息才能更具体。具体答案需要您提供更多详细信息。
归档时间: |
|
查看次数: |
16597 次 |
最近记录: |