使用wamp服务器进行DNS查找失败

时间:2015-01-26 10:58:41

标签: php dns wamp

我已经安装了wamp 2.5和apache 2.4.9。我在www文件夹中添加了一个简单的php文件。当我尝试从localhost访问它时,我收到以下消息:

The server at main can't be found, because the DNS lookup failed. DNS is the
network service that translates a website's name to its Internet address. This
error is most often caused by having no connection to the Internet or a
misconfigured network. It can also be caused by an unresponsive DNS server or
a firewall preventing Google Chrome from accessing the network.

DNS查找失败问题的解决方案是什么?我正在使用Windows 7.

1 个答案:

答案 0 :(得分:1)

通过输入http://main/,您似乎正在尝试访问该网页。问题是Google-Chrome会尝试解析域main,但由于它不存在而失败。

一种解决方案是将mainhosts添加到C:\Windows\System32\Drivers\etc\hosts中的ServerName文件,提供更详细的帮助here

更好的方法是检查您在Apache中使用{{1}}指令配置的服务器的名称,并尝试使用它。