我不知道为什么我无法解决。我肯定我遗漏了一些东西,希望有人能帮忙。
我已经安装了 Ubuntu 12.04 服务器。设置为静态后,我无法解析主机名(公平地说,我没有在 DHCP 时对其进行测试)。
我的路由器的 LAN IP 是 10.0.1.1,在大多数情况下,这将解析 DNS,但为了以防万一,我将其更改为开放 DNS 服务器。
但我仍然得到:
root@WCULS-1:~# host google.com
;; connection timed out; no servers could be reached
这是我现在的/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 208.67.222.222
nameserver 208.67.220.220
/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
# iface eth0 inet dhcp
iface eth0 inet static
address 10.0.1.10
netmask 255.255.255.0
network 10.0.1.0
broadcast 10.0.1.255
gatway 10.0.1.1
/etc/resolvconfig/resolv.confd/base
nameserver 208.67.222.222
nameserver 208.67.220.220
感谢您花时间阅读我的问题。
答案1
问题是我在 /etc/network/interfaces 中拼错了网关,一旦我进行拼写更正,这就解决了我的查找问题。